move tests to testament (#16101)
* move tests to testament * minor * fix random * disable test random
This commit is contained in:
parent
d306a04466
commit
cbc793b30b
56 changed files with 2205 additions and 2232 deletions
|
|
@ -345,28 +345,3 @@ func is5xx*(code: HttpCode): bool {.inline.} =
|
|||
|
||||
func `$`*(httpMethod: HttpMethod): string =
|
||||
return (system.`$`(httpMethod))[4 .. ^1].toUpperAscii()
|
||||
|
||||
when isMainModule:
|
||||
var test = newHttpHeaders()
|
||||
test["Connection"] = @["Upgrade", "Close"]
|
||||
doAssert test["Connection", 0] == "Upgrade"
|
||||
doAssert test["Connection", 1] == "Close"
|
||||
test.add("Connection", "Test")
|
||||
doAssert test["Connection", 2] == "Test"
|
||||
doAssert "upgrade" in test["Connection"]
|
||||
|
||||
# Bug #5344.
|
||||
doAssert parseHeader("foobar: ") == ("foobar", @[""])
|
||||
let (key, value) = parseHeader("foobar: ")
|
||||
test = newHttpHeaders()
|
||||
test[key] = value
|
||||
doAssert test["foobar"] == ""
|
||||
|
||||
doAssert parseHeader("foobar:") == ("foobar", @[""])
|
||||
|
||||
block: # test title case
|
||||
var testTitleCase = newHttpHeaders(titleCase=true)
|
||||
testTitleCase.add("content-length", "1")
|
||||
doAssert testTitleCase.hasKey("Content-Length")
|
||||
for key, val in testTitleCase:
|
||||
doAssert key == "Content-Length"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue