move tests to testament (#16101)

* move tests to testament

* minor

* fix random

* disable test random
This commit is contained in:
flywind 2020-11-25 02:06:41 +08:00 • committed by GitHub
commit cbc793b30b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
56 changed files with 2205 additions and 2232 deletions

View file

@ -59,18 +59,3 @@ proc setCookie*(key, value: string, expires: DateTime|Time,
return setCookie(key, value, domain, path,
format(expires.utc, "ddd',' dd MMM yyyy HH:mm:ss 'GMT'"),
noname, secure, httpOnly)
when isMainModule:
let expire = fromUnix(0) + 1.seconds
let cookies = [
setCookie("test", "value", expire),
setCookie("test", "value", expire.local),
setCookie("test", "value", expire.utc)
]
let expected = "Set-Cookie: test=value; Expires=Thu, 01 Jan 1970 00:00:01 GMT"
doAssert cookies == [expected, expected, expected]
let table = parseCookies("uid=1; kp=2")
doAssert table["uid"] == "1"
doAssert table["kp"] == "2"