Skip to content

Commit 2557a3c

Browse files
committed
Added test cases to cover more than 16 arguments for a new() and function call
1 parent 85b94a7 commit 2557a3c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/test_function.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@ def test_new_keyword(context):
2828
{
2929
return "Hello, " + this.who + "!";
3030
}
31+
32+
function MoreThan16Arguments(a1, a2, a3, a4, b1, b2, b3, b4, c1, c2, c3, c4, d1, d2, d3, d4, e1, e2, e3, e4)
33+
{
34+
this.data = [a1, a2, a3, a4, b1, b2, b3, b4, c1, c2, c3, c4, d1, d2, d3, d4, e1, e2, e3, e4];
35+
}
36+
37+
function MoreThan16Arguments2(a1, a2, a3, a4, b1, b2, b3, b4, c1, c2, c3, c4, d1, d2, d3, d4, e1, e2, e3, e4)
38+
{
39+
return [a1, a2, a3, a4, b1, b2, b3, b4, c1, c2, c3, c4, d1, d2, d3, d4, e1, e2, e3, e4];
40+
}
3141
""")
3242

3343
f = context.glob.NewKeywordTest
@@ -53,3 +63,8 @@ def test_new_keyword(context):
5363

5464
res = instance.test()
5565
assert res == "Hello, world!"
66+
67+
args = [2, 4, 6, 23, 54, 2, 8, 43, -1, 100, 200, 300, 3, 4, 5, 23, 5, 38, 10, 29]
68+
instance = new(context.glob.MoreThan16Arguments, *args)
69+
assert instance.data == args
70+
assert context.glob.MoreThan16Arguments2(*args) == args

0 commit comments

Comments
 (0)