Skip to content

Commit

Permalink
tests: test-net: double destroy the handlle
Browse files Browse the repository at this point in the history
test that double destroying is OK on socket handles
  • Loading branch information
philips authored and Brandon Philips committed Aug 14, 2012
1 parent 14e55fb commit 9eba8d2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/test-net.lua
Expand Up @@ -44,9 +44,12 @@ server:listen(PORT, HOST, function(err)
client:on('data', function(data)
assert(#data == 5)
assert(data == 'hello')
client:destroy()
-- Ensure double destroy doesn't return an error
client:destroy()
server:close()
server:close()
-- Ensure double close returns an error
local success, err = pcall(server.close, server)
assert(success == false)
Expand Down

0 comments on commit 9eba8d2

Please sign in to comment.