Initial commit.
This commit is contained in:
2
test/config.nims
Normal file
2
test/config.nims
Normal file
@ -0,0 +1,2 @@
|
||||
switch("path", "../src")
|
||||
switch("verbosity", "0")
|
BIN
test/runner
Executable file
BIN
test/runner
Executable file
Binary file not shown.
3
test/runner.nim
Normal file
3
test/runner.nim
Normal file
@ -0,0 +1,3 @@
|
||||
import unittest
|
||||
|
||||
import ./tauth, ./tjson_util
|
0
test/tauth.nim
Normal file
0
test/tauth.nim
Normal file
23
test/tjsonutils.nim
Normal file
23
test/tjsonutils.nim
Normal file
@ -0,0 +1,23 @@
|
||||
import json, times, unittest, uuids
|
||||
import buffoonery/jsonutils
|
||||
|
||||
suite "jsonutils":
|
||||
|
||||
let n = %*{
|
||||
"numVal": 12345,
|
||||
"strVal": "Test string",
|
||||
"uuid": $genUUID(),
|
||||
"isoDate": "2021-07-19T16:20:32+00:00",
|
||||
"month": "2021-07"
|
||||
}
|
||||
|
||||
test "getOrFail":
|
||||
check:
|
||||
n.getOrFail("strVal").getStr == "Test string"
|
||||
n.getOrFail("numVal").getInt == 12345
|
||||
|
||||
expect(ValueError):
|
||||
discard n.getOrFail("missingVal")
|
||||
|
||||
test "parseMonth":
|
||||
check n.parseMonth("month") == "2021-07".parse(MONTH_FORMAT)
|
Reference in New Issue
Block a user