Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
tests: test-net: ensure double close returns error
call :close twice to ensure we get an error the second time
  • Loading branch information
Brandon Philips committed Aug 8, 2012
1 parent ff2be5c commit df9a2b6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/test-net.lua
Expand Up @@ -46,8 +46,10 @@ server:listen(PORT, HOST, function(err)
assert(data == 'hello')
client:destroy()
server:close()
-- Ensure double close doesn't assert and returns an error
local success, err = pcall(server:close())
-- Ensure double close returns an error
local success, err = pcall(server.close, server)
assert(success == false)
assert(err)
end)
Expand Down

0 comments on commit df9a2b6

Please sign in to comment.