From 4453aa1d72d407818e0abf3939299611d5997eab Mon Sep 17 00:00:00 2001 From: Mathias Jean Johansen Date: Sun, 1 May 2022 13:14:44 +0200 Subject: Add `first` function to `String`s. --- test/gleam/string_test.gleam | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test') diff --git a/test/gleam/string_test.gleam b/test/gleam/string_test.gleam index 937df50..a98a2e2 100644 --- a/test/gleam/string_test.gleam +++ b/test/gleam/string_test.gleam @@ -364,3 +364,13 @@ pub fn to_option_test() { |> string.to_option |> should.equal(Some("ok")) } + +pub fn first_test() { + "" + |> string.first + |> should.equal(None) + + "gleam" + |> string.first + |> should.equal(Some("g")) +} -- cgit v1.2.3