~andyc/oil

25291dd3c0f26debeec8f4d26c85108fe411acc5 — Andy Chu 2 months ago bd50c99
[spec/bugs] Repro 'readonly' bug in bash found by Travis Everett.
1 files changed, 39 insertions(+), 0 deletions(-)

M spec/bugs.test.sh
M spec/bugs.test.sh => spec/bugs.test.sh +39 -0
@@ 19,3 19,42 @@ echo $a
## N-I dash/ash stdout-json: ""
## N-I dash/ash status: 2


#### assign readonly -- one line
readonly x=1; x=2; echo hi
## status: 1
## OK dash/mksh/ash status: 2
## STDOUT:
## END

#### assign readonly -- multiple lines
readonly x=1
x=2
echo hi
## status: 1
## OK dash/mksh/ash status: 2
## STDOUT:
## END
## BUG bash status: 0
## BUG bash STDOUT:
hi
## END

#### unset readonly -- one line
readonly x=1; unset x; echo hi
## STDOUT:
hi
## END
## OK dash/ash status: 2
## OK zsh status: 1
## OK dash/ash stdout-json: ""
## OK zsh stdout-json: ""

#### unset readonly -- multiple lines
readonly x=1
unset x
echo hi
## OK dash/ash status: 2
## OK zsh status: 1
## OK dash/ash stdout-json: ""
## OK zsh stdout-json: ""