diff options
author | Marcin Puc <marcin.e.puc@gmail.com> | 2021-10-11 22:59:25 +0200 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2021-10-12 20:54:39 +0100 |
commit | 992cb2f0d4e86827c9e9e65ec13f9d9c30dcad87 (patch) | |
tree | cdcd1b0d2c71fb6d9900aa0639c67cd7e020ad4b /test | |
parent | 357bbf83d8b1bf821f0a59cf563f18bf70573e50 (diff) | |
download | gleam_stdlib-992cb2f0d4e86827c9e9e65ec13f9d9c30dcad87.tar.gz gleam_stdlib-992cb2f0d4e86827c9e9e65ec13f9d9c30dcad87.zip |
Rename list.head to list.first
Diffstat (limited to 'test')
-rw-r--r-- | test/gleam/function_test.gleam | 8 | ||||
-rw-r--r-- | test/gleam/list_test.gleam | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/test/gleam/function_test.gleam b/test/gleam/function_test.gleam index 0b3bd8c..e86beb3 100644 --- a/test/gleam/function_test.gleam +++ b/test/gleam/function_test.gleam @@ -18,17 +18,17 @@ pub fn compose_test() { // Takes a list of ints and returns the head as a string (if there is one, or // else "0" if there is not) - let head_to_string = - list.head + let first_to_string = + list.first |> function.compose(result.unwrap(_, 0)) |> function.compose(int.to_string) [1] - |> head_to_string + |> first_to_string |> should.equal("1") [] - |> head_to_string + |> first_to_string |> should.equal("0") } diff --git a/test/gleam/list_test.gleam b/test/gleam/list_test.gleam index b0d81c3..d505ddc 100644 --- a/test/gleam/list_test.gleam +++ b/test/gleam/list_test.gleam @@ -49,11 +49,11 @@ pub fn contains_test() { |> should.be_false } -pub fn head_test() { - list.head([0, 4, 5, 7]) +pub fn first_test() { + list.first([0, 4, 5, 7]) |> should.equal(Ok(0)) - list.head([]) + list.first([]) |> should.equal(Error(Nil)) } |