/
niceSOFT
/
swig
Обзор
Документация
Войти
/
niceSOFT
/
swig
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Examples/lua/constants/runme.lua
28 строк
1001 B
Erez Geva
Remove Lua 5.0 and Lua 5.1 and Lua options
30 май 2026, 19:24
30 май 2026, 19:24
74ff929
Код
Авторство
О чём код?
-- file: example.lua ---- importing ---- require('example') print("ICONST = "..example.ICONST.." (should be 42)") print("FCONST = "..example.FCONST.." (should be 2.1828)") print("CCONST = "..example.CCONST.." (should be 'x')") print("CCONST2 = "..example.CCONST2.." (this should be on a new line)") print("SCONST = "..example.SCONST.." (should be 'Hello World')") print("SCONST2 = "..example.SCONST2.." (should be '\"Hello World\"')") print("EXPR = "..example.EXPR.." (should be 48.5484)") print("iconst = "..example.iconst.." (should be 37)") print("fconst = "..example.fconst.." (should be 3.14)") -- helper to check that a fn failed function checkfail(fn) if pcall(fn)==true then print("that shouldn't happen, it worked") else print("function failed as expected") end end -- these should fail -- example.EXTERN is a nil value, so concatenation will make it fail checkfail(function() print("EXTERN = "..example.EXTERN) end) checkfail(function() print("FOO = "..example.FOO) end)