aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorinoas <mail@inoas.com>2022-12-09 09:10:36 +0100
committerLouis Pilfold <louis@lpil.uk>2022-12-22 20:44:33 +0000
commit9dc8bc4b3e9b58396ceae3e2bb466c1eb4679f86 (patch)
tree6f2e022109d024886f789dc6380e36be35d0a94e /test
parent48f47291d190ce02701a23a431fda9d8dab99ac1 (diff)
downloadgleam_stdlib-9dc8bc4b3e9b58396ceae3e2bb466c1eb4679f86.tar.gz
gleam_stdlib-9dc8bc4b3e9b58396ceae3e2bb466c1eb4679f86.zip
replace string.to_ints with string.utf_codepoint_to_int
Diffstat (limited to 'test')
-rw-r--r--test/gleam/string_test.gleam28
1 files changed, 5 insertions, 23 deletions
diff --git a/test/gleam/string_test.gleam b/test/gleam/string_test.gleam
index d8c62d6..07bbfb9 100644
--- a/test/gleam/string_test.gleam
+++ b/test/gleam/string_test.gleam
@@ -487,31 +487,13 @@ pub fn bit_string_utf_codepoint_test() {
should.equal(<<snake:utf8_codepoint>>, <<"🐍":utf8>>)
}
-pub fn to_ints_test() {
- ""
- |> string.to_ints
- |> should.equal([])
-
- "abc"
- |> string.to_ints
- |> should.equal([97, 98, 99])
-
- "🐍"
- |> string.to_ints
- |> should.equal([128013])
-
+pub fn utf_codepoint_to_int_test() {
{
- assert Ok(cp) = string.utf_codepoint(128013)
- [cp]
+ assert Ok(ordinal_value) = string.utf_codepoint(128_013)
+ ordinal_value
}
- |> string.from_utf_codepoints
- |> string.to_ints
- |> should.equal([128013])
-
- string.to_utf_codepoints("🐍")
- |> string.from_utf_codepoints
- |> string.to_ints
- "🐍"
+ |> string.utf_codepoint_to_int
+ |> should.equal(128_013)
}
pub fn to_option_test() {