Skip to content

Commit

Permalink
Fix surrogate testing character ranges
Browse files Browse the repository at this point in the history
  • Loading branch information
devinus committed Jun 25, 2021
1 parent 52adec8 commit 1eed4de
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test/poison/encoder_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ defmodule Poison.EncoderTest do
assert to_json(value) == ~s("#{value}")
end

check all str <- string(Enum.concat(0xA0..0xD800, 0xE000..0x10000)),
check all str <- string(Enum.concat(0xA0..0xD7FF, 0xE000..0x10000)),
str != "",
elem <- member_of(String.codepoints(str)),
<<codepoint::utf8>> = elem do
Expand Down
2 changes: 1 addition & 1 deletion test/poison/parser_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ defmodule Poison.ParserTest do
assert parse!(~s("#{str}")) == str
end

check all value <- integer(0x0..0xD800) do
check all value <- integer(0x0..0xD7FF) do
seq = value |> Integer.to_string(16) |> String.pad_leading(4, "0")
assert parse!(~s("\\u#{seq}")) == <<value::utf8>>
end
Expand Down

0 comments on commit 1eed4de

Please # to comment.