From dba1285ca98d7a325f05b77b805089b3edd61867 Mon Sep 17 00:00:00 2001 From: SoniEx2 Date: Tue, 4 Jun 2024 23:48:59 -0300 Subject: Implement cratera REPL --- test/interp-error.cratera | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 test/interp-error.cratera (limited to 'test') 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 -- cgit 1.4.1