diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/stdlib/tnetconnect.nim | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/stdlib/tnetconnect.nim b/tests/stdlib/tnetconnect.nim new file mode 100644 index 000000000..e27499651 --- /dev/null +++ b/tests/stdlib/tnetconnect.nim @@ -0,0 +1,22 @@ +discard """ + cmd: "nim c -r -d:ssl $file" + exitcode: 0 +""" + +import std/net + +# Issue 15215 - https://github.com/nim-lang/Nim/issues/15215 +proc test() = + var + ctx = newContext() + socket = newSocket() + + wrapSocket(ctx, socket) + + connect(socket, "www.nim-lang.org", Port(443), 5000) + + send(socket, "GET / HTTP/1.0\nHost: www.nim-lang.org\nConnection: close\n\n") + + close(socket) + +test() |