ysh-json () { run-file ysh-json "$@" } run-file () { local spec_name=$1; shift; sh-spec spec/$spec_name.test.sh --compare-shells --oils-bin-dir $PWD/bin "$@" } ysh-json: spec test case results

Results for ysh-json.test.sh

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

Details on runs that didn't PASS

osh46 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