run-file () { local spec_name=$1; shift; local spec_file=spec/$spec_name.test.sh; local suite; suite=$(test/sh_spec.py --print-spec-suite $spec_file); local spec_subdir; case $suite in osh) spec_subdir='osh-cpp' ;; ysh) spec_subdir='ysh-cpp' ;; *) die "Invalid suite $suite" ;; esac; local base_dir=_tmp/spec/$spec_subdir; mkdir -v -p $base_dir; sh-spec $spec_file --timeout 10 --oils-bin-dir $PWD/bin --oils-cpp-bin-dir $REPO_ROOT/_bin/cxx-asan --tsv-output $base_dir/${spec_name}.tsv "$@" } ysh-json: spec test case results

Results for ysh-json.test.sh

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