Permalink
Please sign in to comment.
Showing
with
31 additions
and 0 deletions.
- +5 −0 spec.sh
- +26 −0 tests/sh-options.test.sh
| @@ -0,0 +1,26 @@ | ||
| #!/bin/bash | ||
| # | ||
| # Test set flags, sh flags. | ||
| ### nounset | ||
| echo "[$unset]" | ||
| set -o nounset | ||
| echo "[$unset]" | ||
| echo end # never reached | ||
| # stdout: [] | ||
| # status: 1 | ||
| # OK dash status: 2 | ||
| ### -u is nounset | ||
| echo "[$unset]" | ||
| set -u | ||
| echo "[$unset]" | ||
| echo end # never reached | ||
| # stdout: [] | ||
| # status: 1 | ||
| # OK dash status: 2 | ||
| ### sh -c | ||
| $SH -c 'echo hi' | ||
| # stdout: hi | ||
| # status: 0 |
0 comments on commit
df654ea