public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Cc: base-system@gentoo.org, "Michał Górny" <mgorny@gentoo.org>
Subject: [gentoo-dev] [PATCH 1/2] eclass/tests/estack_eshopts.sh: Add tests for 'set' variant of eshopt*
Date: Fri, 24 Mar 2017 22:01:56 +0100	[thread overview]
Message-ID: <20170324210157.27562-1-mgorny@gentoo.org> (raw)

---
 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



             reply	other threads:[~2017-03-24 21:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-24 21:01 Michał Górny [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170324210157.27562-1-mgorny@gentoo.org \
    --to=mgorny@gentoo.org \
    --cc=base-system@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox