diff options
author | Étienne Lévesque <contact@etiennel.dev> | 2022-10-23 17:29:39 -0400 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2022-10-25 14:49:22 +0100 |
commit | 816c59e72f7bfd98bd9ab1f2e5e7f8c8ba594cc2 (patch) | |
tree | 0cb4640e5c405fff54b4e9cd51e9791d8e9b6cd9 | |
parent | 44f719f0993af76b89cc24c4026370bb040725fc (diff) | |
download | gleam_stdlib-816c59e72f7bfd98bd9ab1f2e5e7f8c8ba594cc2.tar.gz gleam_stdlib-816c59e72f7bfd98bd9ab1f2e5e7f8c8ba594cc2.zip |
Add tests
-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) +} |