1
0
Fork 0
mirror of https://github.com/Reuh/candran.git synced 2026-02-04 02:08:40 +00:00

fix: fix Lua 5.5 tests

This commit is contained in:
Étienne Fildadut 2025-12-26 15:48:21 +01:00
parent 4e05ac9320
commit 3dc6ad3cf5

View file

@ -1157,20 +1157,21 @@ foo = 12
]]) ]])
if _VERSION >= "Lua 5.5" then if _VERSION >= "Lua 5.5" then
test("global variable declaration", [[ test("global variable declaration", [[
do global foo = 42
global foo
global <const> bar
end
foo = 42
assert(not pcall(function() foo = 42 end))
]]) ]])
test("global variable declaration with error", [[
global foo = 42
bar = 12
]], { "loadError", "variable 'bar' not declared" })
test("global variable declaration with attribute", [[
global <const> bar
bar = 42
]], { "loadError", "attempt to assign to const variable 'bar'" })
test("collective global variable declaration with attribute", [[ test("collective global variable declaration with attribute", [[
foo = 42 foo = 42
do
global<const> * global<const> *
end foo = 12
assert(not pcall(function() foo = 12 end)) ]], { "loadError", "attempt to assign to const variable 'foo'" })
]])
end end
-- bitwise operators -- bitwise operators