From 665be265b91bef1c5aa00de30435d8b7c20e7f27 Mon Sep 17 00:00:00 2001 From: AlexCodesApps <141887614+AlexCodesApps@users.noreply.github.com> Date: Tue, 17 Dec 2024 15:55:37 +0100 Subject: included test and updated changelog --- CHANGELOG.md | 1 + test/gleam/string_test.gleam | 3 +++ 2 files changed, 4 insertions(+) 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() { -- cgit v1.2.3