Skip to content

Commit

Permalink
[spec/ysh-json] Fix a couple tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy C committed Jan 4, 2024
1 parent 3d99861 commit dc0e930
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions data_lang/pyj8.py
Expand Up @@ -164,6 +164,8 @@ def WriteString(s, options, buf):
buf.write("'")

else:
# NOTE: Our J8 encoder still emits "\u0001", not u'\u{1}'. I guess
# this is OK for now, but we might want a strict mode.
buf.write('"')
_EscapeUnprintable(s, buf)
buf.write('"')
Expand Down
4 changes: 2 additions & 2 deletions spec/ysh-json.test.sh
Expand Up @@ -239,7 +239,7 @@ j8 write (b)
## STDOUT:
"mu μ \u0001 \" \\ \b\f\n\r\t"
"\u0001\u001f"
b"\yff"
b'\yff'
## END

#### Escaping uses \u0001 in "", but \u{1} in b""
Expand All @@ -252,7 +252,7 @@ j8 write (s2)

## STDOUT:
"\u0001"
b"\u{1}\yff\u{1f}"
b'\u{1}\yff\u{1f}'
## END


Expand Down

0 comments on commit dc0e930

Please sign in to comment.