aboutsummaryrefslogtreecommitdiff
path: root/test/utf_codepoint_test.gleam
blob: a3747ba57da602c8a1ae0b829f44f5aa5051f0b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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(<<snake:utf8_codepoint>>, <<"🐍":utf8>>)
}