diff options
author | Michał Górny <mgorny@gentoo.org> | 2017-03-11 14:25:42 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2017-03-18 08:33:16 +0100 |
commit | f7a4c94d344b6c73773bf83bd397ba468386e294 (patch) | |
tree | c6f666a98059eae3eb2afabc621f4ef4a89f789e /eclass/tests/estack_eshopts.sh | |
parent | eutils.eclass: Deprecate validate_desktop_entries (diff) | |
download | gentoo-f7a4c94d344b6c73773bf83bd397ba468386e294.tar.gz gentoo-f7a4c94d344b6c73773bf83bd397ba468386e294.tar.bz2 gentoo-f7a4c94d344b6c73773bf83bd397ba468386e294.zip |
estack.eclass: Split estack* logic from eutils
Split the estack_* and related functions from eutils into a dedicated
estack.eclass. Those functions have significant complexity and are not
used frequently, therefore they benefit from having a separate file
and an explicit dedicated maintainer.
The new eclass is implicitly inherited by eutils to preserve
compatibility. However, the inherit will be removed in EAPI 7,
and the ebuilds should switch to using estack directly.
Thanks to Ulrich Müller for doing the research on this.
Diffstat (limited to 'eclass/tests/estack_eshopts.sh')
-rwxr-xr-x | eclass/tests/estack_eshopts.sh | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/eclass/tests/estack_eshopts.sh b/eclass/tests/estack_eshopts.sh new file mode 100755 index 000000000000..606a17cfb053 --- /dev/null +++ b/eclass/tests/estack_eshopts.sh @@ -0,0 +1,46 @@ +#!/bin/bash +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +source tests-common.sh + +inherit estack + +test-it() { + local s0 s1 s2 + + tbegin "push/pop '$*'" + s0=$(shopt -p) + t eshopts_push $* + s1=$(shopt -p) + t eshopts_pop + s2=$(shopt -p) + [[ ${s0} == "${s2}" ]] && \ + [[ ${s1} == *"shopt $*"* ]] + tend $? +} + +# should handle bug #395025 +for arg in nullglob dotglob extglob ; do + for flag in s u ; do + test-it -${flag} ${arg} + done +done + +tbegin "multi push/pop" +s0=$(shopt -p) +t eshopts_push -s dotglob +t eshopts_push -u dotglob +t eshopts_push -s extglob +t eshopts_push -u dotglob +t eshopts_push -s dotglob +t eshopts_pop +t eshopts_pop +t eshopts_pop +t eshopts_pop +t eshopts_pop +s1=$(shopt -p) +[[ ${s0} == "${s1}" ]] +tend $? + +texit |