aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTristan Cacqueray <tdecacqu@redhat.com>2021-12-06 22:23:03 +0000
committerLouis Pilfold <louis@lpil.uk>2021-12-09 17:58:06 +0000
commit3599e3c29c16c2cfd12c76a5dcbe6d55e9f396d3 (patch)
tree5a2d95b0083e4857ba50c7a504093f92ecc50699 /test
parent88a9c8a5c0230827ec04b137994dd0e310515a94 (diff)
downloadgleam_stdlib-3599e3c29c16c2cfd12c76a5dcbe6d55e9f396d3.tar.gz
gleam_stdlib-3599e3c29c16c2cfd12c76a5dcbe6d55e9f396d3.zip
Add function.constant
This change adds a new helper to the function module.
Diffstat (limited to 'test')
-rw-r--r--test/gleam/function_test.gleam7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/gleam/function_test.gleam b/test/gleam/function_test.gleam
index e86beb3..1495d2a 100644
--- a/test/gleam/function_test.gleam
+++ b/test/gleam/function_test.gleam
@@ -2,6 +2,7 @@ import gleam/should
import gleam/dynamic
import gleam/function
import gleam/int
+import gleam/pair
import gleam/list
import gleam/result
import gleam/string
@@ -107,3 +108,9 @@ pub fn identity_test() {
|> function.identity
|> should.equal(#(1, 2.0))
}
+
+pub fn always_test() {
+ #(1, 2)
+ |> pair.map_first(function.constant(42))
+ |> should.equal(#(42, 2))
+}