aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMathias Jean Johansen <mathias@mjj.io>2022-05-02 18:01:13 +0200
committerLouis Pilfold <louis@lpil.uk>2022-05-04 22:08:15 +0100
commit0f9e6e6306290400ea031db921fad4dd68ba3564 (patch)
treee95a064075bf7e55413ec53790efbc4aa3baec5c /test
parentbcea3cf65a63f948784d70425d6fc46ae648b1e4 (diff)
downloadgleam_stdlib-0f9e6e6306290400ea031db921fad4dd68ba3564.tar.gz
gleam_stdlib-0f9e6e6306290400ea031db921fad4dd68ba3564.zip
Refactor `first` to return a `Result`.
Diffstat (limited to 'test')
-rw-r--r--test/gleam/string_test.gleam6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/gleam/string_test.gleam b/test/gleam/string_test.gleam
index 31c93ad..56b50a0 100644
--- a/test/gleam/string_test.gleam
+++ b/test/gleam/string_test.gleam
@@ -368,15 +368,15 @@ pub fn to_option_test() {
pub fn first_test() {
""
|> string.first
- |> should.equal(None)
+ |> should.be_error
"gleam"
|> string.first
- |> should.equal(Some("g"))
+ |> should.equal(Ok("g"))
"⭐️ Gleam"
|> string.first
- |> should.equal(Some("⭐️"))
+ |> should.equal(Ok("⭐️"))
}
pub fn last_test() {