Initial commit.

This commit is contained in:
2022-01-22 18:50:29 -06:00
commit 3777e3dbbd
13 changed files with 362 additions and 0 deletions

2
test/config.nims Normal file
View File

@ -0,0 +1,2 @@
switch("path", "../src")
switch("verbosity", "0")

BIN
test/runner Executable file

Binary file not shown.

3
test/runner.nim Normal file
View File

@ -0,0 +1,3 @@
import unittest
import ./tauth, ./tjson_util

0
test/tauth.nim Normal file
View File

23
test/tjsonutils.nim Normal file
View 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)