diff options
author | flywind <43030857+xflywind@users.noreply.github.com> | 2020-12-28 07:13:21 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-28 14:13:21 +0100 |
commit | 6d442a40a6f89572052d61aeb73ec26d1f3451ce (patch) | |
tree | 6867049dcd37c9610f91e93058580d87b5ca8bb2 /tests/stdlib/thttpcore.nim | |
parent | f9a15dbae909f4521cd506bedf7ec500c4f4d9f8 (diff) | |
download | Nim-6d442a40a6f89572052d61aeb73ec26d1f3451ce.tar.gz |
use doAssert in tests (#16486)
Diffstat (limited to 'tests/stdlib/thttpcore.nim')
-rw-r--r-- | tests/stdlib/thttpcore.nim | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/tests/stdlib/thttpcore.nim b/tests/stdlib/thttpcore.nim index fd5e1d90c..6f88e9536 100644 --- a/tests/stdlib/thttpcore.nim +++ b/tests/stdlib/thttpcore.nim @@ -2,31 +2,31 @@ import httpcore, strutils block: block HttpCode: - assert $Http418 == "418 I'm a teapot" - assert Http418.is4xx() == true - assert Http418.is2xx() == false + doAssert $Http418 == "418 I'm a teapot" + doAssert Http418.is4xx() == true + doAssert Http418.is2xx() == false block headers: var h = newHttpHeaders() - assert h.len == 0 + doAssert h.len == 0 h.add("Cookie", "foo") - assert h.len == 1 - assert h.hasKey("cooKIE") - assert h["Cookie"] == "foo" - assert h["cookie"] == "foo" + doAssert h.len == 1 + doAssert h.hasKey("cooKIE") + doAssert h["Cookie"] == "foo" + doAssert h["cookie"] == "foo" h["cookie"] = @["bar", "x"] - assert h["Cookie"] == "bar" - assert h["Cookie", 1] == "x" - assert h["Cookie"].contains("BaR") == true - assert h["Cookie"].contains("X") == true - assert "baR" in h["cookiE"] + doAssert h["Cookie"] == "bar" + doAssert h["Cookie", 1] == "x" + doAssert h["Cookie"].contains("BaR") == true + doAssert h["Cookie"].contains("X") == true + doAssert "baR" in h["cookiE"] h.del("coOKie") - assert h.len == 0 + doAssert h.len == 0 # Test that header constructor works with repeated values let h1 = newHttpHeaders({"a": "1", "a": "2", "A": "3"}) - assert seq[string](h1["a"]).join(",") == "1,2,3" + doAssert seq[string](h1["a"]).join(",") == "1,2,3" block test_cookies_with_comma: doAssert parseHeader("cookie: foo, bar") == ("cookie", @["foo, bar"]) |