Fixed net tests.
h3rald h3rald@h3rald.com
Sat, 02 Jun 2018 22:35:05 +0200
2 files changed,
7 insertions(+),
7 deletions(-)
M
lib/min_net.nim
→
lib/min_net.nim
@@ -51,7 +51,7 @@ protocol = IPPROTO_RAW
elif (sProtocol == "icmp"): protocol = IPPROTO_ICMP var socket = newSocket(domain, sockettype, protocol) - var skt = newSeq[MinValue](0).newVal(i.scope) + var skt = newDict(i.scope) skt = i.dset(skt, "domain", sDomain.newVal) skt = i.dset(skt, "type", sSockType.newVal) skt = i.dset(skt, "protocol", sProtocol.newVal)
M
tests/net.min
→
tests/net.min
@@ -3,13 +3,13 @@ 'test import
"net" describe - () socket =srv1 - () socket =srv2 - () socket =cli1 - () socket =cli2 + {} socket :srv1 + {} socket :srv2 + {} socket :cli1 + {} socket :cli2 - () socket "httpbin.org" 80 connect #cli1 + {} socket "httpbin.org" 80 connect @cli1 "min v$1" (version) => % :user-agent "GET /user-agent HTTP/1.1\r\nHost: httpbin.org\r\nUser-Agent: $1\r\n\r\n" (user-agent) => % :req@@ -19,7 +19,7 @@ cli1 req send
cli1 recv-line :line (response line) => "\n" join @response - (line "}" !=) + (line "\}" match not) ( cli1 recv-line @line (response line) => "\n" join @response