1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
REQUIRE_MODULE LUA
INCLUDE $TOP/test/config.htb
BLOCK:LUA MyLuaThing param1 param2 : ret1 ret2
function expect(param, value)
if param ~= value then
error(param.." is not equal "..value)
end
end
assert(param1)
assert(param1 == "Hello World")
assert(param2)
assert(param2 == "Hehehe")
expect(param1, "Hello World")
expect(param2, "Hehehe")
print()
for i=1,10 do
print("hallo "..i.." "..param1.." "..param2)
end
return "foo", "bar", "bla", "asdf"
END
CLIENT
MyLuaThing "Hello World" "Hehehe" FOO BAR
_DEBUG FOO == $FOO ; BAR == $BAR
_EXPECT VAR(FOO) "foo"
_EXPECT VAR(BAR) "bar"
END
|