aboutsummaryrefslogtreecommitdiff
path: root/spec/common.lua
diff options
context:
space:
mode:
authorAlexander M Pickering <alex@cogarr.net>2023-11-24 21:45:42 -0600
committerAlexander M Pickering <alex@cogarr.net>2023-11-24 21:45:42 -0600
commitb26614f10d13835c8a9b6856abcad6ad057c904e (patch)
tree29f5ea3cc0e1bc784c610a8b272e141e5d03aba0 /spec/common.lua
parentda0d5a002e69faf69c4cbc9720248f3b556ee011 (diff)
downloadbrokengine-b26614f10d13835c8a9b6856abcad6ad057c904e.tar.gz
brokengine-b26614f10d13835c8a9b6856abcad6ad057c904e.tar.bz2
brokengine-b26614f10d13835c8a9b6856abcad6ad057c904e.zip
Add some asserts and fix the networking test
Diffstat (limited to 'spec/common.lua')
-rw-r--r--spec/common.lua10
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/common.lua b/spec/common.lua
index 4df1a7c..f1eee04 100644
--- a/spec/common.lua
+++ b/spec/common.lua
@@ -10,9 +10,9 @@ else -- windows
end
function common.rungame()
- f = io.popen(game_bin .. " spec/headless","r")
- d = f:read("*all")
- f:close()
+ f = assert(io.popen(game_bin .. " spec/headless","r"))
+ d = assert(f:read("*all"))
+ assert(f:close())
--print(d)
return d
end
@@ -21,8 +21,8 @@ function common.runboth()
--print("Running both")
--Do we have a race condition here? (Can client start and send it's message
--before the server is ready to accept?
- f1 = io.popen(server_bin .. " spec/server","r")
- f2 = io.popen(game_bin .. " spec/headless","r")
+ f1 = assert(io.popen(server_bin .. " spec/server","r"))
+ f2 = assert(io.popen(game_bin .. " spec/headless","r"))
--print("Both ran...")
d1 = f1:read("*all")
d2 = f2:read("*all")