Skip to content

Commit

Permalink
Add varargs test
Browse files Browse the repository at this point in the history
  • Loading branch information
angelcaru committed May 31, 2024
1 parent 085cd3c commit 67c3e1c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 10 deletions.
20 changes: 20 additions & 0 deletions tests/varargs.rn
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

fun f(...args) {
print(args)
}

fun g(a, ...args) {
print(a)
print(args)
}

f()
f(1, 2, 3)
f("hello", "world", "!")
f("a", "b", "c")

g(1)
g(1, 2, 3)
g("hello", "world", "!")
g("a", "b", "c")

1 change: 1 addition & 0 deletions tests/varargs.rn.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"code": 0, "stdout": "[]\n[1, 2, 3]\n[\"hello\", \"world\", \"!\"]\n[\"a\", \"b\", \"c\"]\n1\n[]\n1\n[2, 3]\nhello\n[\"world\", \"!\"]\na\n[\"b\", \"c\"]\n", "stderr": ""}
10 changes: 0 additions & 10 deletions varargs.rn

This file was deleted.

0 comments on commit 67c3e1c

Please sign in to comment.