about summary refs log tree commit diff stats
path: root/test.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2023-01-20 22:13:31 -0800
committerKartik K. Agaram <vc@akkartik.com>2023-01-20 22:13:31 -0800
commiteb26b9ab5e4a95e608c5fb0cde8fb653c260d110 (patch)
treea24842dd071e44e348c2c8e28882a9245b9d6021 /test.lua
parent9f0c797d19af4d4afe76a2a00882b4126ca038d4 (diff)
parent486afb1c6887cef1b89757e6a75fc14c5cc78dd2 (diff)
downloadview.love-eb26b9ab5e4a95e608c5fb0cde8fb653c260d110.tar.gz
Merge text.love
Diffstat (limited to 'test.lua')
-rw-r--r--test.lua17
1 files changed, 4 insertions, 13 deletions
diff --git a/test.lua b/test.lua
index ab890b8..cc94d94 100644
--- a/test.lua
+++ b/test.lua
@@ -1,29 +1,20 @@
 -- Some primitives for tests.
---
--- Success indicators go to the terminal; failures go to the window.
--- I don't know what I am doing.
 
 function check(x, msg)
-  if x then
-    io.write('.')
-  else
+  if not x then
     error(msg)
   end
 end
 
 function check_nil(x, msg)
-  if x == nil then
-    io.write('.')
-  else
+  if x ~= nil then
     error(msg..'; should be nil but got "'..x..'"')
   end
 end
 
 function check_eq(x, expected, msg)
-  if eq(x, expected) then
-    io.write('.')
-  else
-    error(msg..'; got "'..x..'"')
+  if not eq(x, expected) then
+    error(msg..'; should be "'..expected..'" but got "'..x..'"')
   end
 end