diff options
| -rw-r--r-- | FIX | 1 | ||||
| -rw-r--r-- | test/excepttest.lua | 6 | ||||
| -rw-r--r-- | test/unixtest.lua | 10 |
3 files changed, 17 insertions, 0 deletions
| @@ -7,3 +7,4 @@ new timming functions. higher resolution, no wrap around | |||
| 7 | bug fixes in the manual | 7 | bug fixes in the manual |
| 8 | getfd missing cast | 8 | getfd missing cast |
| 9 | added unix domain support example | 9 | added unix domain support example |
| 10 | fixed local domain socket kludge of name size | ||
diff --git a/test/excepttest.lua b/test/excepttest.lua new file mode 100644 index 0000000..ce9f197 --- /dev/null +++ b/test/excepttest.lua | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | local socket = require("socket") | ||
| 2 | try = socket.newtry(function() | ||
| 3 | print("finalized!!!") | ||
| 4 | end) | ||
| 5 | try = socket.protect(try) | ||
| 6 | print(try(nil, "it works")) | ||
diff --git a/test/unixtest.lua b/test/unixtest.lua new file mode 100644 index 0000000..e70b356 --- /dev/null +++ b/test/unixtest.lua | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | socket = require("socket") | ||
| 2 | f = loadlib("etc-1.0.dylib", "unix_open") | ||
| 3 | f(socket) | ||
| 4 | u = socket.unix() | ||
| 5 | print(u:bind("/tmp/luasocket")) | ||
| 6 | print(u:listen()) | ||
| 7 | c = u:accept() | ||
| 8 | while 1 do | ||
| 9 | print(assert(c:receive())) | ||
| 10 | end | ||
