From 1eed4deffc6c500abf38c1c80ee860244f7fa469 Mon Sep 17 00:00:00 2001 From: Devin Alexander Torres Date: Thu, 24 Jun 2021 23:19:39 -0500 Subject: [PATCH] Fix surrogate testing character ranges --- test/poison/encoder_test.exs | 2 +- test/poison/parser_test.exs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/poison/encoder_test.exs b/test/poison/encoder_test.exs index 4c324a0..bc251bf 100644 --- a/test/poison/encoder_test.exs +++ b/test/poison/encoder_test.exs @@ -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)), <> = elem do diff --git a/test/poison/parser_test.exs b/test/poison/parser_test.exs index dee2c9a..11fb174 100644 --- a/test/poison/parser_test.exs +++ b/test/poison/parser_test.exs @@ -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}")) == <> end