|
@@ -306,4 +306,13 @@ assert(not load"a = 'non-ending string\n'")
|
|
|
assert(not load"a = '\\345'")
|
|
|
assert(not load"a = [=x]")
|
|
|
|
|
|
+local function malformednum (n, exp)
|
|
|
+ local s, msg = load("return " .. n)
|
|
|
+ assert(not s and string.find(msg, exp))
|
|
|
+end
|
|
|
+
|
|
|
+malformednum("0xe-", "near <eof>")
|
|
|
+malformednum("0xep-p", "malformed number")
|
|
|
+malformednum("1print()", "malformed number")
|
|
|
+
|
|
|
print('OK')
|