diff --git a/.github/workflows/debug.yml b/.github/workflows/debug.yml index ab53e4d..edc8a55 100644 --- a/.github/workflows/debug.yml +++ b/.github/workflows/debug.yml @@ -27,6 +27,9 @@ jobs: nim --version echo "NIM_OK=1" + - name: Compile and run lock test + run: nim c --threads:on --path:src -r tests/test_lock.nim + - name: Run join_tests run: timeout 30 nim c -d:ssl --threads:on --path:src -r tests/join_tests.nim diff --git a/tests/test_lock.nim b/tests/test_lock.nim new file mode 100644 index 0000000..8e4cbbd --- /dev/null +++ b/tests/test_lock.nim @@ -0,0 +1,17 @@ +import std/unittest +import std/locks +import barabadb/storage/lsm + +suite "Lock test": + test "initLock works": + var l: Lock + initLock(l) + acquire(l) + release(l) + check true + + test "newLSMTree works": + var db = newLSMTree("/tmp/test_lock_lsm") + check db != nil + db.put("key1", @[1'u8, 2'u8]) + check true