Skip to content

Commit

Permalink
[test/spec] Failing test cases for #698 and #702.
Browse files Browse the repository at this point in the history
- spec/glob: #698
- spec/var-op-strip: #702

Reported by Crestwave.
  • Loading branch information
Andy Chu committed Apr 15, 2020
1 parent ef69fe6 commit 1cd0ad0
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 2 deletions.
8 changes: 8 additions & 0 deletions spec/glob.test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,14 @@ set -o noglob
echo _tmp/spec-tmp/*.zz
## stdout-json: "_tmp/spec-tmp/a.zz _tmp/spec-tmp/b.zz\n_tmp/spec-tmp/*.zz\n"

#### set -o noglob (bug #698)
var='\z'
set -f
echo $var
## STDOUT:
\z
## END

#### shopt -s nullglob
argv.py _tmp/spec-tmp/*.nonexistent
shopt -s nullglob
Expand Down
27 changes: 27 additions & 0 deletions spec/var-op-strip.test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -298,3 +298,30 @@ argv.py "${x%%}"
['\xce\xbcabc\xce\xbc']
['\xce\xbcabc\xce\xbc']
## END

#### Strip Right Brace (#702)
var='$foo'
echo 1 "${var#$foo}"
echo 2 "${var#\$foo}"

var='}'
echo 10 "${var#}}"
echo 11 "${var#\}}"
echo 12 "${var#'}'}"
echo 13 "${var#"}"}"
## STDOUT:
1 $foo
2
10 }}
11
12
13
## END
## BUG zsh STDOUT:
1 $foo
2
10 }}
11
12 }'}
13
## END
4 changes: 2 additions & 2 deletions test/spec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ sh-func() {

glob() {
# Note: can't pass because it assumes 'bin' exists, etc.
sh-spec spec/glob.test.sh --no-cd-tmp --osh-failures-allowed 7 \
sh-spec spec/glob.test.sh --no-cd-tmp --osh-failures-allowed 8 \
${REF_SHELLS[@]} $BUSYBOX_ASH $OSH_LIST "$@"
}

Expand Down Expand Up @@ -570,7 +570,7 @@ var-op-bash() {
}

var-op-strip() {
sh-spec spec/var-op-strip.test.sh \
sh-spec spec/var-op-strip.test.sh --osh-failures-allowed 1 \
${REF_SHELLS[@]} $ZSH $BUSYBOX_ASH $OSH_LIST "$@"
}

Expand Down

0 comments on commit 1cd0ad0

Please sign in to comment.