Start adding tests, using testament.

FossilOrigin-Name: 6f368f0d303c65000c74f346b7bc39ffca964aff7767c60be2384739e5dc4d72
This commit is contained in:
mahlon 2025-03-18 02:21:06 +00:00
parent 89e879ca68
commit 1ed442a68a
16 changed files with 200 additions and 44 deletions

View file

@ -23,12 +23,19 @@ include
"kuzu/connection.nim",
"kuzu/queries.nim"
proc kuzuVersionCompatible*(): bool =
## Returns true if the system installed Kuzu library
## is the expected version of this library wrapper.
result = KUZU_EXPECTED_LIBVERSION == KUZU_LIBVERSION
when isMainModule:
echo "Nim-Kuzu version: ", KUZU_VERSION,
". Expected library version: ", KUZU_EXPECTED_LIBVERSION, "."
echo "Installed Kuzu library version ", KUZU_LIBVERSION,
" (storage version ", KUZU_STORAGE_VERSION, ")"
if KUZU_EXPECTED_LIBVERSION == KUZU_LIBVERSION:
if kuzuVersionCompatible():
echo "Versions match!"
else:
echo "This library wraps a different version of Kuzu than what is installed."

View file

@ -3,8 +3,8 @@
const KUZU_VERSION* = "0.1.0"
const KUZU_EXPECTED_LIBVERSION* = "0.8.2"
let KUZU_LIBVERSION* = kuzu_get_version()
let KUZU_STORAGE_VERSION* = kuzu_get_storage_version()
let KUZU_LIBVERSION* = $kuzu_get_version()
let KUZU_STORAGE_VERSION* = kuzu_get_storage_version().int
let KUZU_DEFAULT_CONFIG* = kuzu_default_system_config()