Skip to content

Commit

Permalink
[spec/ysh-comand-sub] Failing test for @() and J8 lines
Browse files Browse the repository at this point in the history
This is #1126.

Minor re-org in data_lang/
  • Loading branch information
Andy Chu committed Jan 30, 2024
1 parent 8c63282 commit 41ac36c
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 10 deletions.
13 changes: 7 additions & 6 deletions data_lang/README.md
Expand Up @@ -18,20 +18,21 @@ Shared test code:

C library used by CPython, using `malloc() realloc()`:

j8c.{h,c} j8c_test.c
j8_libc.{h,c} j8_libc_test.c

Parser and printer in Python, translated by mycpp:

j8.py


## Packle

TODO
pyj8.py # function that can be optimized in C++
j8_lite.py # string-only functions, used by ASDL runtime
# so it must have few dependencies

## UTF-8

Tests for different implementations:

utf8_test.cc

## Packle

TODO
2 changes: 1 addition & 1 deletion data_lang/demo.sh → data_lang/quoting-survey.sh
Expand Up @@ -6,7 +6,7 @@
# - Those with terminal escape sequences
#
# Usage:
# data_lang/demo.sh <function name>
# data_lang/quoting-survey.sh <function name>

set -o nounset
set -o pipefail
Expand Down
24 changes: 21 additions & 3 deletions spec/ysh-command-sub.test.sh
@@ -1,6 +1,8 @@
# @( conflict
## oils_failures_allowed: 1


#### conflict with extglob @( cna be avoided with ,(

#### extglob
shopt -s extglob

[[ foo.py == @(*.sh|*.py) ]]
Expand Down Expand Up @@ -63,7 +65,23 @@ b
c
## END

#### Idiomatic for loop using @(seq $n)
#### @() decodes J8 Lines

var b = @(
echo " unquoted ";
# I guess this is allowed
echo $'binary \xff';
echo '"json\n\u03bc"';
echo "u'j8 u \\u{3bc}'";
echo "b'j8 b \\y{ff'";
)

pp line (b)

## STDOUT:
## END

#### for loop using @(seq $n)
shopt -s oil:upgrade

for x in @(seq 3) {
Expand Down

0 comments on commit 41ac36c

Please sign in to comment.