aboutsummaryrefslogtreecommitdiff
path: root/tools/regression
diff options
context:
space:
mode:
authorJilles Tjoelker <jilles@FreeBSD.org>2011-02-20 14:18:58 +0000
committerJilles Tjoelker <jilles@FreeBSD.org>2011-02-20 14:18:58 +0000
commita9942298fefc781c25300084add38761d33a4923 (patch)
treef650b11438e6ef03666dd65b10f20d57917cc074 /tools/regression
parentba13377a7e91ef426307c5dafc89927f15e5e8cc (diff)
downloadsrc-a9942298fefc781c25300084add38761d33a4923.tar.gz
src-a9942298fefc781c25300084add38761d33a4923.zip
sh: Split off some special behaviour into separate tests.
This allows some other shells to pass the tests for basic behaviour.
Notes
Notes: svn path=/head/; revision=218889
Diffstat (limited to 'tools/regression')
-rw-r--r--tools/regression/bin/sh/builtins/trap3.01
-rw-r--r--tools/regression/bin/sh/builtins/trap8.07
-rw-r--r--tools/regression/bin/sh/parser/for1.02
-rw-r--r--tools/regression/bin/sh/parser/for2.015
4 files changed, 23 insertions, 2 deletions
diff --git a/tools/regression/bin/sh/builtins/trap3.0 b/tools/regression/bin/sh/builtins/trap3.0
index 41bdd61747ae..81607293531e 100644
--- a/tools/regression/bin/sh/builtins/trap3.0
+++ b/tools/regression/bin/sh/builtins/trap3.0
@@ -8,5 +8,4 @@
trap - 99999 && exit 3
trap true 99999 && exit 3
} 2>/dev/null
-test -n "$(trap true garbage TERM 2>/dev/null || trap)" || exit 3
exit 0
diff --git a/tools/regression/bin/sh/builtins/trap8.0 b/tools/regression/bin/sh/builtins/trap8.0
new file mode 100644
index 000000000000..cdce976e36da
--- /dev/null
+++ b/tools/regression/bin/sh/builtins/trap8.0
@@ -0,0 +1,7 @@
+# $FreeBSD$
+
+# I am not sure if POSIX requires the shell to continue processing
+# further trap names in the same trap command after an invalid one.
+
+test -n "$(trap true garbage TERM 2>/dev/null || trap)" || exit 3
+exit 0
diff --git a/tools/regression/bin/sh/parser/for1.0 b/tools/regression/bin/sh/parser/for1.0
index 64e14420a4d4..eb7c881237fd 100644
--- a/tools/regression/bin/sh/parser/for1.0
+++ b/tools/regression/bin/sh/parser/for1.0
@@ -13,7 +13,7 @@ for s1 in "$nl" " "; do
done
done
set -- $list
-for s2 in "$nl" " " ";" ";$nl"; do # s2=";" and ";$nl" are extensions to POSIX
+for s2 in "$nl" " "; do
for s3 in "$nl" " "; do
r=''
eval "for i${s2}do${s3}r=\"\$r \$i\"; done"
diff --git a/tools/regression/bin/sh/parser/for2.0 b/tools/regression/bin/sh/parser/for2.0
new file mode 100644
index 000000000000..54ebfc3d7193
--- /dev/null
+++ b/tools/regression/bin/sh/parser/for2.0
@@ -0,0 +1,15 @@
+# $FreeBSD$
+
+# Common extensions to the 'for' syntax.
+
+nl='
+'
+list=' a b c'
+set -- $list
+for s2 in ";" ";$nl"; do
+ for s3 in "$nl" " "; do
+ r=''
+ eval "for i${s2}do${s3}r=\"\$r \$i\"; done"
+ [ "$r" = "$list" ] || exit 1
+ done
+done