sh: Add tests for some somewhat obscure aspects of function definitions.
authorPeter Avalos <pavalos@dragonflybsd.org>
Sun, 25 Dec 2011 18:01:22 +0000 (10:01 -0800)
committerPeter Avalos <pavalos@dragonflybsd.org>
Sun, 25 Dec 2011 18:01:22 +0000 (10:01 -0800)
Obtained-from:  FreeBSD 222512

tools/regression/bin/sh/parser/func2.0 [new file with mode: 0644]
tools/regression/bin/sh/parser/func3.0 [new file with mode: 0644]

diff --git a/tools/regression/bin/sh/parser/func2.0 b/tools/regression/bin/sh/parser/func2.0
new file mode 100644 (file)
index 0000000..7b8be82
--- /dev/null
@@ -0,0 +1,6 @@
+# $FreeBSD: src/tools/regression/bin/sh/parser/func2.0,v 1.1 2011/05/30 21:49:59 jilles Exp $
+
+f() { return 42; }
+f() { return 3; } &
+f
+[ $? -eq 42 ]
diff --git a/tools/regression/bin/sh/parser/func3.0 b/tools/regression/bin/sh/parser/func3.0
new file mode 100644 (file)
index 0000000..4079bf0
--- /dev/null
@@ -0,0 +1,6 @@
+# $FreeBSD: src/tools/regression/bin/sh/parser/func3.0,v 1.1 2011/05/30 21:49:59 jilles Exp $
+
+name=/var/empty/nosuch
+f() { true; } <$name
+name=/dev/null
+f