summary refs log tree commit diff stats
path: root/lib/pure/httpcore.nim
diff options
context:
space:
mode:
authorflywind <43030857+xflywind@users.noreply.github.com>2020-11-25 02:06:41 +0800
committerGitHub <noreply@github.com>2020-11-24 19:06:41 +0100
commitcbc793b30b10b8e82af7313ac8cd438abf97f7d7 (patch)
tree84c1ee6cc25ef9f4e407d0492c9a66deac87712f /lib/pure/httpcore.nim
parentd306a04466b7f1129620dc3ab35443119ed4c867 (diff)
downloadNim-cbc793b30b10b8e82af7313ac8cd438abf97f7d7.tar.gz
move tests to testament (#16101)
* move tests to testament

* minor

* fix random

* disable test random
Diffstat (limited to 'lib/pure/httpcore.nim')
-rw-r--r--lib/pure/httpcore.nim25
1 files changed, 0 insertions, 25 deletions
diff --git a/lib/pure/httpcore.nim b/lib/pure/httpcore.nim
index 401e78b9b..7ead64d83 100644
--- a/lib/pure/httpcore.nim
+++ b/lib/pure/httpcore.nim
@@ -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"