summary refs log tree commit diff stats
path: root/test/interp-error.cratera
diff options
context:
space:
mode:
Diffstat (limited to 'test/interp-error.cratera')
-rw-r--r--test/interp-error.cratera10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/interp-error.cratera b/test/interp-error.cratera
new file mode 100644
index 0000000..cf177ed
--- /dev/null
+++ b/test/interp-error.cratera
@@ -0,0 +1,10 @@
+-- Test interpreter error handling.
+if arg[1] == "nil" then
+    error(nil)
+elseif arg[1] == "string" then
+    error("string")
+elseif arg[1] == "table" then
+    error({})
+elseif arg[1] == "metaerror" then
+    error(setmetatable({}, {__tostring=error}))
+end