Skip to content

Commit

Permalink
Use nph v0.6.0 in nimble format and run format on project. (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
bhartnett authored Jul 22, 2024
1 parent 9a6d85e commit 608d10a
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
# Updating nph version should be accompanied with running the new
# version on the project directory.
run: |
VERSION="v0.5.1"
VERSION="v0.6.0"
ARCHIVE="nph-linux_x64.tar.gz"
curl -L "https://github.com/arnetheduck/nph/releases/download/${VERSION}/${ARCHIVE}" -o ${ARCHIVE}
tar -xzf ${ARCHIVE}
Expand Down
2 changes: 1 addition & 1 deletion rocksdb.nimble
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ requires "nim >= 1.6", "results", "tempfile", "unittest2"
task format, "Format nim code using nph":
# Using the latest nph commit for now because the latest tagged version
# doesn't work with the latest nim 2 version
exec "nimble install nph@#head"
exec "nimble install nph@0.6.0"
exec "nph ."

task clean, "Remove temporary files":
Expand Down
3 changes: 1 addition & 2 deletions rocksdb/rocksdb.nim
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,7 @@ proc keyExists*(
db.get(
key,
proc(data: openArray[byte]) =
discard
,
discard,
cfHandle,
)

Expand Down
6 changes: 2 additions & 4 deletions tests/test_columnfamily.nim
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,12 @@ suite "ColFamily Tests":
check cf.get(
key,
proc(data: openArray[byte]) =
bytes = @data
,
bytes = @data,
)[]
check not cf.get(
otherKey,
proc(data: openArray[byte]) =
bytes = @data
,
bytes = @data,
)[]

var r1 = cf.get(key)
Expand Down
39 changes: 13 additions & 26 deletions tests/test_rocksdb.nim
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,12 @@ suite "RocksDbRef Tests":
check db.get(
key,
proc(data: openArray[byte]) =
bytes = @data
,
bytes = @data,
)[]
check not db.get(
otherKey,
proc(data: openArray[byte]) =
bytes = @data
,
bytes = @data,
)[]

var r1 = db.get(key)
Expand Down Expand Up @@ -97,15 +95,13 @@ suite "RocksDbRef Tests":
check db.get(
key,
proc(data: openArray[byte]) =
bytes = @data
,
bytes = @data,
defaultCfHandle,
)[]
check not db.get(
otherKey,
proc(data: openArray[byte]) =
bytes = @data
,
bytes = @data,
defaultCfHandle,
)[]

Expand Down Expand Up @@ -159,31 +155,27 @@ suite "RocksDbRef Tests":
check db.get(
key,
proc(data: openArray[byte]) =
bytes = @data
,
bytes = @data,
defaultCfHandle,
)[]
check not db.get(
otherKey,
proc(data: openArray[byte]) =
bytes = @data
,
bytes = @data,
defaultCfHandle,
)[]

var bytes2: seq[byte]
check db.get(
otherKey,
proc(data: openArray[byte]) =
bytes2 = @data
,
bytes2 = @data,
otherCfHandle,
)[]
check not db.get(
key,
proc(data: openArray[byte]) =
bytes2 = @data
,
bytes2 = @data,
otherCfHandle,
)[]

Expand Down Expand Up @@ -259,8 +251,7 @@ suite "RocksDbRef Tests":
let r = db.get(
key1,
proc(data: openArray[byte]) =
v = @data
,
v = @data,
)
check:
r.isOk()
Expand All @@ -273,8 +264,7 @@ suite "RocksDbRef Tests":
let r = db.get(
key2,
proc(data: openArray[byte]) =
v = @data
,
v = @data,
)
check:
r.isOk()
Expand All @@ -287,8 +277,7 @@ suite "RocksDbRef Tests":
let r = db.get(
key3,
proc(data: openArray[byte]) =
v = @data
,
v = @data,
)
check:
r.isOk()
Expand All @@ -301,8 +290,7 @@ suite "RocksDbRef Tests":
let r = db.get(
key4,
proc(data: openArray[byte]) =
v = @data
,
v = @data,
)
check:
r.isOk()
Expand All @@ -315,8 +303,7 @@ suite "RocksDbRef Tests":
let r = db.get(
key5,
proc(data: openArray[byte]) =
v = @data
,
v = @data,
)
check:
r.isOk()
Expand Down

0 comments on commit 608d10a

Please sign in to comment.