summaryrefslogtreecommitdiffstats
path: root/tests/010
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-06-02 08:15:08 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-06-02 08:15:08 -0700
commitd178ddaac5b58c3a0d8b024884859d7ef3c24386 (patch)
tree428a60ab8836eb54218a7e61fd191cc6753c6eee /tests/010
parent98a5ae664df526c18bac5d4597c3ae165cd0fd20 (diff)
downloadtxr-d178ddaac5b58c3a0d8b024884859d7ef3c24386.tar.gz
txr-d178ddaac5b58c3a0d8b024884859d7ef3c24386.tar.bz2
txr-d178ddaac5b58c3a0d8b024884859d7ef3c24386.zip
json: fix two test cases for Windows.
* tests/010/json.tl: on Windows characters are limited to the BMP range 0 to #\xFFFF. The character escape \x10437 is out of range, and so throws an error, simply from that syntax being read. The two test cases which use this character are clumped into their own test form, which is executed conditionally on wide characters being more than two bytes. Because the expression is still parsed on Windows, we read the troublesome character from a string at run-time, and interpolate it.
Diffstat (limited to 'tests/010')
-rw-r--r--tests/010/json.tl7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/010/json.tl b/tests/010/json.tl
index 68544f07..843b7b58 100644
--- a/tests/010/json.tl
+++ b/tests/010/json.tl
@@ -25,13 +25,16 @@
#J"" ""
#J"\u0000" "\xdc00"
#J"\u0001" "\x1"
- #J"\ud801\udc37" "\x10437"
#J"a\u0000b" "a\xdc00;b"
#J"a\u0001b" "a\x1;b"
- #J"a\ud801\udc37b" "a\x10437;b"
#J"\b\t\n\f\r" "\b\t\n\f\r"
#J"\/\\\"" "/\\\"")
+(when (> (sizeof wchar) 2)
+ (let ((chr (read "\"\\x10437\"")))
+ (vtest #J"\ud801\udc37" `@chr`)
+ (vtest #J"a\ud801\udc37b" `a@{chr}b`)))
+
(mtest
#J[] #()
#J[ ] #()