1
0
forked from Mirror/wren
Files
wren/test/core/function/call_extra_arguments.wren
Bob Nystrom 64eccdd9be Reorganize tests and benchmark scripts.
Mainly to get rid of one top level directory. But this will
also be useful when there are tests of the embedding API.
2015-03-14 12:45:56 -07:00

17 lines
539 B
Plaintext

var f0 = new Fn { IO.print("zero") }
var f1 = new Fn {|a| IO.print("one ", a) }
var f2 = new Fn {|a, b| IO.print("two ", a, " ", b) }
var f3 = new Fn {|a, b, c| IO.print("three ", a, " ", b, " ", c) }
f0.call("a") // expect: zero
f0.call("a", "b") // expect: zero
f1.call("a", "b") // expect: one a
f1.call("a", "b", "c") // expect: one a
f2.call("a", "b", "c") // expect: two a b
f2.call("a", "b", "c", "d") // expect: two a b
f3.call("a", "b", "c", "d") // expect: three a b c
f3.call("a", "b", "c", "d", "e") // expect: three a b c