public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH 1/2] eclass/tests/estack_eshopts.sh: Add tests for 'set' variant of eshopt*
@ 2017-03-24 21:01 Michał Górny
  2017-03-24 21:01 ` [gentoo-dev] [PATCH 2/2] estack.eclass: Use 'shopt -p -o' to restore 'set' flags Michał Górny
  2017-04-14 16:31 ` [gentoo-dev] [PATCH 1/2] eclass/tests/estack_eshopts.sh: Add tests for 'set' variant of eshopt* Michał Górny
  0 siblings, 2 replies; 3+ messages in thread
From: Michał Górny @ 2017-03-24 21:01 UTC (permalink / raw
  To: gentoo-dev; +Cc: base-system, Michał Górny

---
 eclass/tests/estack_eshopts.sh | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/eclass/tests/estack_eshopts.sh b/eclass/tests/estack_eshopts.sh
index 606a17cfb053..28346c65ec13 100755
--- a/eclass/tests/estack_eshopts.sh
+++ b/eclass/tests/estack_eshopts.sh
@@ -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
-- 
2.12.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-04-14 16:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-24 21:01 [gentoo-dev] [PATCH 1/2] eclass/tests/estack_eshopts.sh: Add tests for 'set' variant of eshopt* Michał Górny
2017-03-24 21:01 ` [gentoo-dev] [PATCH 2/2] estack.eclass: Use 'shopt -p -o' to restore 'set' flags Michał Górny
2017-04-14 16:31 ` [gentoo-dev] [PATCH 1/2] eclass/tests/estack_eshopts.sh: Add tests for 'set' variant of eshopt* Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox