From 341eb947b4f3f33ea2bf700f629d328444b1df3f Mon Sep 17 00:00:00 2001 From: Tom Whatmore Date: Fri, 19 Jun 2020 11:21:20 +0100 Subject: Add utf_codepoint to stdlib --- test/utf_codepoint_test.gleam | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 test/utf_codepoint_test.gleam (limited to 'test/utf_codepoint_test.gleam') diff --git a/test/utf_codepoint_test.gleam b/test/utf_codepoint_test.gleam new file mode 100644 index 0000000..a3747ba --- /dev/null +++ b/test/utf_codepoint_test.gleam @@ -0,0 +1,16 @@ +import gleam/should +import gleam/utf_codepoint + +pub fn from_int_test() { + utf_codepoint.from_int(1114444) + |> should.be_error + + utf_codepoint.from_int(65534) + |> should.be_error + + utf_codepoint.from_int(55296) + |> should.be_error + + assert Ok(snake) = utf_codepoint.from_int(128013) + should.equal(<>, <<"🐍":utf8>>) +} -- cgit v1.2.3