aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md1
-rw-r--r--test/gleam/string_test.gleam3
2 files changed, 4 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 90ad8d1..c1eaddb 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,7 @@
- The `compare` and `to_int` functions from the `gleam/bool` module have been
deprecated.
+- Fixed a bug where `string.utf_codepoint` would erronously accept negative input.
## v0.46.0 - 2024-12-08
diff --git a/test/gleam/string_test.gleam b/test/gleam/string_test.gleam
index 8ff4f39..ffd2f9b 100644
--- a/test/gleam/string_test.gleam
+++ b/test/gleam/string_test.gleam
@@ -706,6 +706,9 @@ pub fn utf_codepoint_test() {
string.utf_codepoint(55_296)
|> should.be_error
+
+ string.utf_codepoint(-1)
+ |> should.be_error
}
pub fn bit_array_utf_codepoint_test() {