Permalink
Browse files

new test for shell options

  • Loading branch information...
Andy Chu
Andy Chu committed Mar 7, 2017
1 parent 561229c commit df654ea37383066de3b53a3868ab5da643eacdb1
Showing with 31 additions and 0 deletions.
  1. +5 −0 spec.sh
  2. +26 −0 tests/sh-options.test.sh
View
@@ -278,6 +278,11 @@ var-sub-quote() {
${REF_SHELLS[@]} $OSH "$@"
}
sh-options() {
sh-spec tests/sh-options.test.sh --osh-failures-allowed 0 \
${REF_SHELLS[@]} $OSH "$@"
}
#
# Non-POSIX extensions: arrays, brace expansion, [[, ((, etc.
View
@@ -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

Please sign in to comment.