summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2011-12-16 23:40:40 +0000
committerMike Frysinger <vapier@gentoo.org>2011-12-16 23:40:40 +0000
commit2a659f91a5134d056d205cc894df53319f390f7f (patch)
tree2ad9de7dbcf0019c53abafaacf20a8e87de2ec3a /eclass/tests
parentadd new generic stack helpers estack_{push,pop}, rebase eshopts_{push,pop} on... (diff)
downloadhistorical-2a659f91a5134d056d205cc894df53319f390f7f.tar.gz
historical-2a659f91a5134d056d205cc894df53319f390f7f.tar.bz2
historical-2a659f91a5134d056d205cc894df53319f390f7f.zip
small testsuite for estack push/pop and friends
Diffstat (limited to 'eclass/tests')
-rwxr-xr-xeclass/tests/eutils:estack.sh42
1 files changed, 42 insertions, 0 deletions
diff --git a/eclass/tests/eutils:estack.sh b/eclass/tests/eutils:estack.sh
new file mode 100755
index 000000000000..c180d1344022
--- /dev/null
+++ b/eclass/tests/eutils:estack.sh
@@ -0,0 +1,42 @@
+#!/bin/bash
+
+source tests-common.sh
+
+inherit eutils
+
+tbegin "initial stack state"
+estack_pop teststack
+# Should be empty and thus return 1
+[[ $? -eq 1 ]]
+tend $?
+
+tbegin "simple push/pop"
+estack_push ttt 1
+estack_pop ttt
+tend $?
+
+tbegin "simple push/pop var"
+estack_push xxx "boo ga boo"
+estack_pop xxx i
+[[ $? -eq 0 ]] && [[ ${i} == "boo ga boo" ]]
+tend $?
+
+tbegin "multi push/pop"
+estack_push yyy {1..10}
+i=0
+while estack_pop yyy ; do
+ : $(( i++ ))
+done
+[[ ${i} -eq 10 ]]
+tend $?
+
+tbegin "umask push/pop"
+u0=$(umask)
+eumask_push 0000
+u1=$(umask)
+eumask_pop
+u2=$(umask)
+[[ ${u0}:${u1}:${u2} == "${u0}:0000:${u0}" ]]
+tend $?
+
+texit