From 816c59e72f7bfd98bd9ab1f2e5e7f8c8ba594cc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20L=C3=A9vesque?= Date: Sun, 23 Oct 2022 17:29:39 -0400 Subject: Add tests --- test/gleam/function_test.gleam | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) 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) +} -- cgit v1.2.3