summaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2022-03-31 09:30:08 +0200
committerJo-Philipp Wich <jo@mein.io>2022-03-31 09:58:04 +0200
commita37f65471c2b69fa588cbf8e9794ff1fe6d04605 (patch)
treee964e6dd6fd2ff33eaa4dc6164572311fc6468b7 /tests
parentaae5312a6f117ebb4e12ae500d8d3001d59d2db3 (diff)
types: fix escape sequence encoding of high byte values in JSON strings
Treat the char value as unsigned when testing its value to yield consistent results on both platforms with signed chars and those with unsigned chars by default (e.g. ARM ones). This also avoids encoding byte values > 127 as \uXXXX escape sequences, potentially breaking the strng contents. Fixes: #62 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/custom/03_stdlib/01_chr2
-rw-r--r--tests/custom/03_stdlib/27_sprintf4
2 files changed, 3 insertions, 3 deletions
diff --git a/tests/custom/03_stdlib/01_chr b/tests/custom/03_stdlib/01_chr
index 17163e3..47fdb17 100644
--- a/tests/custom/03_stdlib/01_chr
+++ b/tests/custom/03_stdlib/01_chr
@@ -22,6 +22,6 @@ passed to the `chr()` function.
[
"",
"abc",
- "\u0000\u0000\u0000\u0000\u0000AB\u00ff"
+ "\u0000\u0000\u0000\u0000\u0000ABÿ"
]
-- End --
diff --git a/tests/custom/03_stdlib/27_sprintf b/tests/custom/03_stdlib/27_sprintf
index e1a3c5d..5606e9a 100644
--- a/tests/custom/03_stdlib/27_sprintf
+++ b/tests/custom/03_stdlib/27_sprintf
@@ -235,8 +235,8 @@ string value.
"1E-07",
"NAN",
"A",
- "\u00ff",
- "\u00c8",
+ "ÿ",
+ "È",
"\u0000",
"\"Hello\\n\"",
"123",