From 4908297e3293c0ce1f5c207e8d10d09f1599b4c4 Mon Sep 17 00:00:00 2001 From: SoniEx2 Date: Wed, 19 Jun 2024 23:45:21 -0300 Subject: Add more line number tests --- test/line-numbers.cratera | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/line-numbers.cratera b/test/line-numbers.cratera index f2f977b..75bc09b 100644 --- a/test/line-numbers.cratera +++ b/test/line-numbers.cratera @@ -25,6 +25,9 @@ Test. Test. ]] error("test failed") + elseif key == "h" then + error [[ +test failed]] end end @@ -42,4 +45,7 @@ local ok, msg = pcall(mkerror,"f") assert(not ok and msg:match(":21"), msg) local ok, msg = pcall(mkerror,"g") assert(not ok and msg:match(":27"), msg) +local ok, msg = pcall(mkerror,"h") +-- on lua 5.1, cratera line numbers align with the end of the string +assert(not ok and (msg:match(":29") or msg:match(":30")), msg) print("line number tests pass") -- cgit 1.4.1