tests/pass/vararg.lua

Sat, 21 Sep 2013 14:31:22 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Sat, 21 Sep 2013 14:31:22 +0100
changeset 143
a689e0187ef5
parent 126
07ec490c7a6f
permissions
-rw-r--r--

Fix math.frexp() and add more tests (thanks Florob, Link Mauve, xnyhps)

function foo(a, b, ...)
	assert(a == 1);
	assert(b == 2);
	local c, d = ...;
	assert(c == 3);
	assert(d == 4);
	return a, b, ...;
end

local a, b, c, d = foo(1, 2, 3, 4);
assert(a == 1);
assert(b == 2);
print("c is", c);
assert(c == 3);
assert(d == 4);

mercurial