Results for ysh-json.test.sh

statusosh
pass 43
FAIL 2
total45
caseoshdescription
0pass usage errors
1pass json write STRING
2pass json write ARRAY
3pass json write Dict
4pass json write compact format
5pass json write in command sub
6pass json read passed invalid args
7pass json read uses $_reply var
8pass json read with redirect
9pass json read at end of pipeline (relies on lastpipe)
10pass invalid JSON
11pass json write expression
12pass json write evaluation error
13pass json write of List in cycle
14pass json write of Dict in cycle
15pass json read doesn't accept u'' or b'' strings
16pass json write emits Unicode replacement char for binary data \yff
17pass json8 write emits b'' strings for binary data \yff
18pass json8 write bytes vs unicode string
19pass JSON \/ escapes supported
20pass J8 supports superfluous \" escapes, but JSON doesn't support \' escapes
21pass Escaping uses \u0001 in "", but \u{1} in b''
22pass json8 read
23pass json8 round trip
24pass json round trip (regression)
25pass round trip: decode surrogate pair and encode
26FAIL round trip: decode surrogate half and encode
details
27pass toJson() toJ8() - TODO: test difference
28pass fromJson() fromJ8() - TODO: test difference
29pass User can handle errors - toJson() toJ8()
30pass User can handle errors - fromJson() fromJ8()
31pass ASCII control chars can't appear literally in messages
32pass JSON string can have unescaped ' and J8 string can have unescaped "
33pass \yff can't appear in u'' code strings (command)
34pass \yff can't appear in u'' code strings (expr)
35pass \yff can't appear in u'' multiline code strings
36pass \yff can't appear in u'' data strings
37pass \u{dc00} can't be in surrogate range in code (command)
38pass \u{dc00} can't be in surrogate range in code (expr)
39pass \u{dc00} can't be in surrogate range in data
40FAIL Inf and NaN can't be encoded or decoded
details
41pass Invalid UTF-8 in JSON is rejected
42pass Invalid JSON in J8 is rejected
43pass '' means the same thing as u''
44pass decode deeply nested structure (stack overflow)
43 passed, 0 OK, 0 not implemented, 0 BUG, 2 failed, 0 timeouts, 0 cases skipped
2 failed under osh

Details on runs that didn't PASS

osh26 round trip: decode surrogate half and encode

[osh stdout] Expected '(Str) b\'\\ya0\\ybe\'\n"\\ud83e"\n(Str) b\'\\yb4\\ya6\'\n"\\udd26"\n' Got '(Str) b\'\\ya0\\ybe\'\n"\xef\xbf\xbd\xef\xbf\xbd"\n(Str) b\'\\yb4\\ya6\'\n"\xef\xbf\xbd\xef\xbf\xbd"\n'

stdout:
(Str)   b'\ya0\ybe'
"��"
(Str)   b'\yb4\ya6'
"��"
stderr:
osh40 Inf and NaN can't be encoded or decoded

[osh status] Expected 2, got 3

stdout:
stderr: 
  var n = float("NaN")
                ^
[ stdin ]:1: fatal: Cannot convert NaN to Float