summaryrefslogtreecommitdiffstats
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
commit4bab3b7ca989beeeb5e9de0e6fa5d96344acc062 (patch)
tree428a60ab8836eb54218a7e61fd191cc6753c6eee
parent09f7d67d89d0976851d6ff14200ffb48b1d00005 (diff)
downloadtxr-4bab3b7ca989beeeb5e9de0e6fa5d96344acc062.tar.gz
txr-4bab3b7ca989beeeb5e9de0e6fa5d96344acc062.tar.bz2
txr-4bab3b7ca989beeeb5e9de0e6fa5d96344acc062.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.
-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[ ] #()