Merge branch 'devel' into sighashes

This commit is contained in:
Andreas Rumpf
2016-12-06 10:08:38 +01:00
10 changed files with 242 additions and 178 deletions

View File

@@ -0,0 +1,28 @@
import unittest
import httpcore
suite "httpcore":
test "HttpCode":
assert $Http418 == "418 I'm a teapot"
assert Http418.is4xx() == true
assert Http418.is2xx() == false
test "headers":
var h = newHttpHeaders()
assert h.len == 0
h.add("Cookie", "foo")
assert h.len == 1
assert h.hasKey("cooKIE")
assert h["Cookie"] == "foo"
assert 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"]
h.del("coOKie")
assert h.len == 0

View File

@@ -1,6 +1,11 @@
discard """
file: "txmltree.nim"
output: "true"
output: '''true
true
true
true
true
'''
"""
import xmltree, strtabs
@@ -9,5 +14,14 @@ var x = <>a(href="nim.de", newText("www.nim-test.de"))
echo($x == "<a href=\"nim.de\">www.nim-test.de</a>")
echo(newText("foo").innerText == "foo")
echo(newEntity("bar").innerText == "bar")
echo(newComment("baz").innerText == "")
let y = newXmlTree("x", [
newText("foo"),
newXmlTree("y", [
newText("bar")
])
])
echo(y.innerText == "foobar")