diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/gleam/function_test.gleam | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/gleam/function_test.gleam b/test/gleam/function_test.gleam index 4034d61..544b295 100644 --- a/test/gleam/function_test.gleam +++ b/test/gleam/function_test.gleam @@ -146,3 +146,24 @@ pub fn apply3_test() { |> function.apply3(1, 2, 3) |> should.equal(6) } + +pub fn apply3_maintains_arguments_orders_test() { + let first = "first" + let second = "second" + let third = "third" + let fun = fn(x1, x2, x3) { + should.equal(x1, first) + should.equal(x2, second) + should.equal(x3, third) + } + + function.apply3(fun, first, second, third) +} + +pub fn apply3_supports_arguments_of_different_types() { + let fun = fn(x1, _x2, _x3) { x1 } + + fun + |> function.apply3(1, 0.5, "3") + |> should.equal(1) +} |