sh testsuite: sync ash-misc/source* and hush-misc/source*
authorDenys Vlasenko <vda.linux@googlemail.com>
Sun, 2 Oct 2016 16:23:14 +0000 (18:23 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sun, 2 Oct 2016 16:23:14 +0000 (18:23 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
shell/ash_test/ash-misc/source5.right [new file with mode: 0644]
shell/ash_test/ash-misc/source5.tests [new file with mode: 0755]
shell/hush_test/hush-misc/source1.right
shell/hush_test/hush-misc/source1.tests
shell/hush_test/hush-misc/source2.right
shell/hush_test/hush-misc/source2.tests
shell/hush_test/hush-misc/source4.right [new file with mode: 0644]
shell/hush_test/hush-misc/source4.tests [new file with mode: 0755]
shell/hush_test/hush-misc/source5.right [new file with mode: 0644]
shell/hush_test/hush-misc/source5.tests [new file with mode: 0755]

diff --git a/shell/ash_test/ash-misc/source5.right b/shell/ash_test/ash-misc/source5.right
new file mode 100644 (file)
index 0000000..0587bad
--- /dev/null
@@ -0,0 +1,4 @@
+0:arg0 1:arg1 2:arg2
+Ok1:0
+0:arg0 1:q 2:w
+Ok2:0
diff --git a/shell/ash_test/ash-misc/source5.tests b/shell/ash_test/ash-misc/source5.tests
new file mode 100755 (executable)
index 0000000..40b6b83
--- /dev/null
@@ -0,0 +1,8 @@
+echo 'echo "0:$0 1:$1 2:$2"' >sourced1
+set -- 1 2 3
+"$THIS_SH" -c '. ./sourced1' arg0 arg1 arg2
+echo Ok1:$?
+"$THIS_SH" -c '. ./sourced1 q w e' arg0 arg1 arg2
+echo Ok2:$?
+
+rm sourced1
index d4256034b3aab446f84caebcfc72e93c6d5c37e0..0ab7c548c27c20e01ff495770510dada3936d9c3 100644 (file)
@@ -1,5 +1,2 @@
-hush: syntax error: unterminated ${name}
-line2
-Ok1:0
-hush: syntax error: unterminated '
-Ok2:1
+Sourced ok
+Done
index c1388835943de940eb586b9f0c1207de5ca18b6b..e2e75b22700ea364e38c6c0501a9d53e92f089c9 100755 (executable)
@@ -1,10 +1,5 @@
-echo 'echo ${^}
-echo line2' >sourced1
-. ./sourced1
-echo Ok1:$?
-
-echo "echo '" >sourced1
-. ./sourced1
-echo Ok2:$?
-
-rm sourced1
+echo "echo Sourced ok" >../sourced.sh
+PATH="..:$PATH"
+. sourced.sh
+rm ../sourced.sh
+echo Done
index 0587bad67791b31727fab9c0bd9b011a1b39aae1..ce7171c87d64d085c77e67d4124288ead8c9a555 100644 (file)
@@ -1,4 +1 @@
-0:arg0 1:arg1 2:arg2
-Ok1:0
-0:arg0 1:q 2:w
-Ok2:0
+Done: 0
index 40b6b83cdb350d9893b829d5f6848ab0b3f26248..1870cdf7e502a8ab82ea1cf8ecdccbee5796ca0d 100755 (executable)
@@ -1,8 +1,3 @@
-echo 'echo "0:$0 1:$1 2:$2"' >sourced1
-set -- 1 2 3
-"$THIS_SH" -c '. ./sourced1' arg0 arg1 arg2
-echo Ok1:$?
-"$THIS_SH" -c '. ./sourced1 q w e' arg0 arg1 arg2
-echo Ok2:$?
-
-rm sourced1
+false
+. /dev/null
+echo Done: $?
diff --git a/shell/hush_test/hush-misc/source4.right b/shell/hush_test/hush-misc/source4.right
new file mode 100644 (file)
index 0000000..d425603
--- /dev/null
@@ -0,0 +1,5 @@
+hush: syntax error: unterminated ${name}
+line2
+Ok1:0
+hush: syntax error: unterminated '
+Ok2:1
diff --git a/shell/hush_test/hush-misc/source4.tests b/shell/hush_test/hush-misc/source4.tests
new file mode 100755 (executable)
index 0000000..c138883
--- /dev/null
@@ -0,0 +1,10 @@
+echo 'echo ${^}
+echo line2' >sourced1
+. ./sourced1
+echo Ok1:$?
+
+echo "echo '" >sourced1
+. ./sourced1
+echo Ok2:$?
+
+rm sourced1
diff --git a/shell/hush_test/hush-misc/source5.right b/shell/hush_test/hush-misc/source5.right
new file mode 100644 (file)
index 0000000..0587bad
--- /dev/null
@@ -0,0 +1,4 @@
+0:arg0 1:arg1 2:arg2
+Ok1:0
+0:arg0 1:q 2:w
+Ok2:0
diff --git a/shell/hush_test/hush-misc/source5.tests b/shell/hush_test/hush-misc/source5.tests
new file mode 100755 (executable)
index 0000000..40b6b83
--- /dev/null
@@ -0,0 +1,8 @@
+echo 'echo "0:$0 1:$1 2:$2"' >sourced1
+set -- 1 2 3
+"$THIS_SH" -c '. ./sourced1' arg0 arg1 arg2
+echo Ok1:$?
+"$THIS_SH" -c '. ./sourced1 q w e' arg0 arg1 arg2
+echo Ok2:$?
+
+rm sourced1