Skip to content

Commit

Permalink
eclass/tests/estack_eshopts.sh: Add tests for 'set' variant of eshopt*
Browse files Browse the repository at this point in the history
  • Loading branch information
mgorny committed Apr 14, 2017
1 parent 6d500fe commit 16112d6
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions eclass/tests/estack_eshopts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,29 @@ for arg in nullglob dotglob extglob ; do
done
done

# test 'set' options
set -f
tbegin "set +f"
s0=$-
t eshopts_push +f
s1=$-
t eshopts_pop
s2=$-
[[ ${s0} == "${s2}" ]] &&
[[ ${s1} != *f* ]]
tend $?

set +f
tbegin "set -f"
s0=$-
t eshopts_push -f
s1=$-
t eshopts_pop
s2=$-
[[ ${s0} == "${s2}" ]] &&
[[ ${s1} == *f* ]]
tend $?

tbegin "multi push/pop"
s0=$(shopt -p)
t eshopts_push -s dotglob
Expand Down

0 comments on commit 16112d6

Please sign in to comment.