Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[spec/interactive] New test file for interactive cases.
Regression for 'exit' not respected in oshrc.
- Loading branch information
Andy Chu
committed
Jul 6, 2019
1 parent
b536f9c
commit e19a904
Showing
3 changed files
with
57 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/usr/bin/env bash | ||
# | ||
|
||
#### 'exit' in oshrc (regression) | ||
cat >$TMP/oshrc <<EOF | ||
echo one | ||
exit 42 | ||
echo two | ||
EOF | ||
$SH --rcfile $TMP/oshrc -i -c 'echo hello' | ||
## status: 42 | ||
## STDOUT: | ||
one | ||
## END | ||
## N-I dash status: 2 | ||
## N-I dash stdout-json: "" | ||
## N-I mksh status: 1 | ||
## N-I mksh stdout-json: "" | ||
|
||
#### fatal errors continue | ||
|
||
# NOTE: tried here doc, but sys.stdin.isatty() fails. Could we fake it? | ||
$SH -i -c ' | ||
echo $(( 1 / 0 )) | ||
echo one | ||
exit 42 | ||
' | ||
## status: 42 | ||
## STDOUT: | ||
one | ||
## END | ||
## N-I dash status: 2 | ||
## N-I dash stdout-json: "" | ||
## N-I mksh status: 1 | ||
## N-I mksh stdout-json: "" | ||
|
||
#### interactive shell loads rcfile (when combined with -c) | ||
$SH -c 'echo 1' | ||
cat >$TMP/rcfile <<EOF | ||
echo RCFILE | ||
EOF | ||
$SH --rcfile $TMP/rcfile -i -c 'echo 2' | ||
## STDOUT: | ||
1 | ||
RCFILE | ||
2 | ||
## END | ||
## N-I dash/mksh STDOUT: | ||
1 | ||
## END | ||
## N-I dash status: 2 | ||
## N-I mksh status: 1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters