blob: e7d73a7b6c65762bb70bd5c652f51af972501894 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
local strict = require 'pl.strict'
local test = require 'pl.test'
local M = strict.module (...)
function M.answer ()
Boo = false -- fine, it's a declared global
-- in strict mode, you cannot assign to globals if you aren't in main
test.assertraise(function()
Foo = true
end," assign to undeclared global 'Foo'")
return 42
end
function M.question ()
return 'what is the answer to Life, the Universe and Everything?'
end
return M
|