Skip to content
Snippets Groups Projects
Commit 5ba01e3a authored by Dmitry E. Oboukhov's avatar Dmitry E. Oboukhov
Browse files

Add tests for socket:write/socket:read, #474

parent 5f7dacba
No related branches found
No related tags found
No related merge requests found
......@@ -1234,6 +1234,20 @@ client:read(#longstring - 1) == string.sub(longstring, 1, #longstring - 1)
---
- true
...
longstring = "Hello\r\n\r\nworld\n\n"
---
...
client = socket.tcp_connect('unix/', path)
---
...
client:read{ line = { "\n\n", "\r\n\r\n" } }
---
- "Hello\r\n\r\n"
...
server:stop()
---
- true
...
os.remove(path)
---
- true
......
......@@ -400,7 +400,6 @@ os.remove(path)
longstring = string.rep("abc", 65535)
server = socket.tcp_server('unix/', path, function(s) s:write(longstring) end)
client = socket.tcp_connect('unix/', path)
......@@ -413,6 +412,14 @@ client = socket.tcp_connect('unix/', path)
client:read(#longstring - 1) == string.sub(longstring, 1, #longstring - 1)
longstring = "Hello\r\n\r\nworld\n\n"
client = socket.tcp_connect('unix/', path)
client:read{ line = { "\n\n", "\r\n\r\n" } }
server:stop()
os.remove(path)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment