Results for ysh-json.test.sh

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

Details on runs that didn't PASS

osh28 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\'\\yed\\ya0\\ybe\'\n"\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd"\n(Str) b\'\\yed\\yb4\\ya6\'\n"\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd"\n'

stdout:
(Str)   b'\yed\ya0\ybe'
"���"
(Str)   b'\yed\yb4\ya6'
"���"
stderr:
osh-cpp28 round trip: decode surrogate half and encode

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

stdout:
(Str)   b'\yed\ya0\ybe'
"���"
(Str)   b'\yed\yb4\ya6'
"���"
stderr:
osh42 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
osh-cpp42 Inf and NaN can't be encoded or decoded

[osh-cpp status] Expected 2, got 3

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