diff --git a/tests/nim.cfg b/tests/nim.cfg index 85bf6c4..89f9c5b 100644 --- a/tests/nim.cfg +++ b/tests/nim.cfg @@ -1 +1,3 @@ --path:"../src/" +--warning[BareExcept]:off +--warning[UnusedImport]:off diff --git a/tests/test_version.nim b/tests/test_version.nim new file mode 100644 index 0000000..5d42150 --- /dev/null +++ b/tests/test_version.nim @@ -0,0 +1,20 @@ +import std/[re, strformat, unittest] +import jacket + +suite "test version": + test "getVersion": + var major, minor, micro, proto: cint + getVersion(major.addr, minor.addr, micro.addr, proto.addr) + #echo fmt"{major}.{minor}.{micro} proto {proto}" + check: + # yes, the function simply returns 0 for all vars :-D + major == 0 + minor == 0 + micro == 0 + proto == 0 + test "getVersionString": + let version = getVersionString() + #echo $version + check: + $typeof(version) == "cstring" + match($version, re(r"\d+\.\d+\.\d+"))