aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/gleam/function_test.gleam48
1 files changed, 48 insertions, 0 deletions
diff --git a/test/gleam/function_test.gleam b/test/gleam/function_test.gleam
index eff4dea..d481893 100644
--- a/test/gleam/function_test.gleam
+++ b/test/gleam/function_test.gleam
@@ -122,3 +122,51 @@ pub fn tap_test() {
})
|> should.equal("Thanks Joe & Louis")
}
+
+pub fn apply1_test() {
+ let fun = fn(x1) { x1 }
+
+ fun
+ |> function.apply1(1)
+ |> should.equal(1)
+}
+
+pub fn apply2_test() {
+ let fun = fn(x1, x2) { x1 + x2 }
+
+ fun
+ |> function.apply2(1, 2)
+ |> should.equal(3)
+}
+
+pub fn apply3_test() {
+ let fun = fn(x1, x2, x3) { x1 + x2 + x3 }
+
+ fun
+ |> function.apply3(1, 2, 3)
+ |> should.equal(6)
+}
+
+pub fn apply4_test() {
+ let fun = fn(x1, x2, x3, x4) { x1 + x2 + x3 + x4 }
+
+ fun
+ |> function.apply4(1, 2, 3, 4)
+ |> should.equal(10)
+}
+
+pub fn apply5_test() {
+ let fun = fn(x1, x2, x3, x4, x5) { x1 + x2 + x3 + x4 + x5 }
+
+ fun
+ |> function.apply5(1, 2, 3, 4, 5)
+ |> should.equal(15)
+}
+
+pub fn apply6_test() {
+ let fun = fn(x1, x2, x3, x4, x5, x6) { x1 + x2 + x3 + x4 + x5 + x6 }
+
+ fun
+ |> function.apply6(1, 2, 3, 4, 5, 6)
+ |> should.equal(21)
+}