summaryrefslogtreecommitdiffstats
path: root/bin/sh/tests
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2015-03-31 20:59:37 +0000
committerjilles <jilles@FreeBSD.org>2015-03-31 20:59:37 +0000
commit1a2e63b4e8737bf7a3a601a1a0c65282ce82bb94 (patch)
treef6397a226b143f6e53ccb6ba4056dc3a5999b0e1 /bin/sh/tests
parentb9ad20386c1d40b8e8a3975deb1eb83caf7e0a7a (diff)
downloadFreeBSD-src-1a2e63b4e8737bf7a3a601a1a0c65282ce82bb94.zip
FreeBSD-src-1a2e63b4e8737bf7a3a601a1a0c65282ce82bb94.tar.gz
sh: Add more tests for exotic IFS splitting.
Diffstat (limited to 'bin/sh/tests')
-rw-r--r--bin/sh/tests/expansion/Makefile2
-rw-r--r--bin/sh/tests/expansion/ifs6.06
-rw-r--r--bin/sh/tests/expansion/ifs7.05
3 files changed, 13 insertions, 0 deletions
diff --git a/bin/sh/tests/expansion/Makefile b/bin/sh/tests/expansion/Makefile
index 0c3e89e..e359ae7 100644
--- a/bin/sh/tests/expansion/Makefile
+++ b/bin/sh/tests/expansion/Makefile
@@ -49,6 +49,8 @@ FILES+= ifs2.0
FILES+= ifs3.0
FILES+= ifs4.0
FILES+= ifs5.0
+FILES+= ifs6.0
+FILES+= ifs7.0
FILES+= length1.0
FILES+= length2.0
FILES+= length3.0
diff --git a/bin/sh/tests/expansion/ifs6.0 b/bin/sh/tests/expansion/ifs6.0
new file mode 100644
index 0000000..be77945
--- /dev/null
+++ b/bin/sh/tests/expansion/ifs6.0
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+IFS=': '
+x=': :'
+set -- $x
+[ "$#|$1|$2|$3" = "2|||" ]
diff --git a/bin/sh/tests/expansion/ifs7.0 b/bin/sh/tests/expansion/ifs7.0
new file mode 100644
index 0000000..0cc0834
--- /dev/null
+++ b/bin/sh/tests/expansion/ifs7.0
@@ -0,0 +1,5 @@
+# $FreeBSD$
+
+IFS=2
+set -- $((123))
+[ "$#|$1|$2|$3" = "2|1|3|" ]
OpenPOWER on IntegriCloud