aboutsummaryrefslogtreecommitdiff
path: root/shell/hush_test
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-03-30 06:50:54 +0000
committerMike Frysinger <vapier@gentoo.org>2009-03-30 06:50:54 +0000
commitd690f68554f1c1301975bc0ab0e479e6870b3589 (patch)
treeedf70533e5a6d316f618fcb1002d14b02dcb3cfe /shell/hush_test
parent5f9f1506ad298c94e816780a3e2d5692d002fb81 (diff)
downloadbusybox-w32-d690f68554f1c1301975bc0ab0e479e6870b3589.tar.gz
busybox-w32-d690f68554f1c1301975bc0ab0e479e6870b3589.tar.bz2
busybox-w32-d690f68554f1c1301975bc0ab0e479e6870b3589.zip
implement `unset` semantics as required by POSIX
Diffstat (limited to 'shell/hush_test')
-rw-r--r--shell/hush_test/hush-vars/unset.right19
-rwxr-xr-xshell/hush_test/hush-vars/unset.tests36
2 files changed, 55 insertions, 0 deletions
diff --git a/shell/hush_test/hush-vars/unset.right b/shell/hush_test/hush-vars/unset.right
new file mode 100644
index 000000000..8dea7c40d
--- /dev/null
+++ b/shell/hush_test/hush-vars/unset.right
@@ -0,0 +1,19 @@
1hush: unset: -: invalid option
21
3hush: unset: -m: invalid option
41
50
6___
70 f g
80 g
90
10___
110 f g
120
130 f g
140
15___
16hush: HUSH_VERSION: readonly variable
171 f g
18hush: HUSH_VERSION: readonly variable
191
diff --git a/shell/hush_test/hush-vars/unset.tests b/shell/hush_test/hush-vars/unset.tests
new file mode 100755
index 000000000..f59ce5923
--- /dev/null
+++ b/shell/hush_test/hush-vars/unset.tests
@@ -0,0 +1,36 @@
1# check invalid options are rejected
2unset -
3echo $?
4unset -m a b c
5echo $?
6
7# check funky usage
8unset
9echo $?
10
11# check normal usage
12echo ___
13f=f g=g
14echo $? $f $g
15unset f
16echo $? $f $g
17unset g
18echo $? $f $g
19
20echo ___
21f=f g=g
22echo $? $f $g
23unset f g
24echo $? $f $g
25f=f g=g
26echo $? $f $g
27unset -v f g
28echo $? $f $g
29
30# check read only vars
31echo ___
32f=f g=g
33unset HUSH_VERSION
34echo $? $f $g
35unset f HUSH_VERSION g
36echo $? $f $g