From 9a595bb36ded308e6d4336aef2c1cd3ac738a398 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 18 May 2015 10:23:16 +0200 Subject: [PATCH] hush: add recent ash tests to hush testsuite too (they all pass for hush) Signed-off-by: Denys Vlasenko --- ...ar-do-not-collapse-arithmetic-expansion-at-parse-time.right | 2 ++ ...ar-do-not-collapse-arithmetic-expansion-at-parse-time.tests | 3 +++ ...-do-not-expand-tilde-in-parameter-expansion-in-quotes.right | 1 + ...-do-not-expand-tilde-in-parameter-expansion-in-quotes.tests | 2 ++ ...te-backslashes-in-parameter-expansions-outside-quotes.right | 1 + ...te-backslashes-in-parameter-expansions-outside-quotes.tests | 3 +++ .../var-pattern-replacement-in-parameter-expansion-1.right | 1 + .../var-pattern-replacement-in-parameter-expansion-1.tests | 2 ++ .../var-pattern-replacement-in-parameter-expansion-2.right | 1 + .../var-pattern-replacement-in-parameter-expansion-2.tests | 2 ++ .../var-pattern-replacement-in-parameter-expansion-3.right | 1 + .../var-pattern-replacement-in-parameter-expansion-3.tests | 2 ++ .../var-pattern-replacement-in-parameter-expansion-4.right | 1 + .../var-pattern-replacement-in-parameter-expansion-4.tests | 2 ++ .../var-pattern-replacement-in-parameter-expansion-5.right | 1 + .../var-pattern-replacement-in-parameter-expansion-5.tests | 2 ++ shell/hush_test/hush-vars/var-runtime-quote-detection.right | 1 + shell/hush_test/hush-vars/var-runtime-quote-detection.tests | 1 + 18 files changed, 29 insertions(+) create mode 100644 shell/hush_test/hush-vars/var-do-not-collapse-arithmetic-expansion-at-parse-time.right create mode 100755 shell/hush_test/hush-vars/var-do-not-collapse-arithmetic-expansion-at-parse-time.tests create mode 100644 shell/hush_test/hush-vars/var-do-not-expand-tilde-in-parameter-expansion-in-quotes.right create mode 100755 shell/hush_test/hush-vars/var-do-not-expand-tilde-in-parameter-expansion-in-quotes.tests create mode 100644 shell/hush_test/hush-vars/var-do-not-quote-backslashes-in-parameter-expansions-outside-quotes.right create mode 100755 shell/hush_test/hush-vars/var-do-not-quote-backslashes-in-parameter-expansions-outside-quotes.tests create mode 100644 shell/hush_test/hush-vars/var-pattern-replacement-in-parameter-expansion-1.right create mode 100755 shell/hush_test/hush-vars/var-pattern-replacement-in-parameter-expansion-1.tests create mode 100644 shell/hush_test/hush-vars/var-pattern-replacement-in-parameter-expansion-2.right create mode 100755 shell/hush_test/hush-vars/var-pattern-replacement-in-parameter-expansion-2.tests create mode 100644 shell/hush_test/hush-vars/var-pattern-replacement-in-parameter-expansion-3.right create mode 100755 shell/hush_test/hush-vars/var-pattern-replacement-in-parameter-expansion-3.tests create mode 100644 shell/hush_test/hush-vars/var-pattern-replacement-in-parameter-expansion-4.right create mode 100755 shell/hush_test/hush-vars/var-pattern-replacement-in-parameter-expansion-4.tests create mode 100644 shell/hush_test/hush-vars/var-pattern-replacement-in-parameter-expansion-5.right create mode 100755 shell/hush_test/hush-vars/var-pattern-replacement-in-parameter-expansion-5.tests create mode 100644 shell/hush_test/hush-vars/var-runtime-quote-detection.right create mode 100755 shell/hush_test/hush-vars/var-runtime-quote-detection.tests diff --git a/shell/hush_test/hush-vars/var-do-not-collapse-arithmetic-expansion-at-parse-time.right b/shell/hush_test/hush-vars/var-do-not-collapse-arithmetic-expansion-at-parse-time.right new file mode 100644 index 000000000..81a15855c --- /dev/null +++ b/shell/hush_test/hush-vars/var-do-not-collapse-arithmetic-expansion-at-parse-time.right @@ -0,0 +1,2 @@ +12 +9 diff --git a/shell/hush_test/hush-vars/var-do-not-collapse-arithmetic-expansion-at-parse-time.tests b/shell/hush_test/hush-vars/var-do-not-collapse-arithmetic-expansion-at-parse-time.tests new file mode 100755 index 000000000..e97a08a57 --- /dev/null +++ b/shell/hush_test/hush-vars/var-do-not-collapse-arithmetic-expansion-at-parse-time.tests @@ -0,0 +1,3 @@ +unset a +echo $((3 + ${a:=$((4 + 5))})) +echo $a diff --git a/shell/hush_test/hush-vars/var-do-not-expand-tilde-in-parameter-expansion-in-quotes.right b/shell/hush_test/hush-vars/var-do-not-expand-tilde-in-parameter-expansion-in-quotes.right new file mode 100644 index 000000000..4b9b4f038 --- /dev/null +++ b/shell/hush_test/hush-vars/var-do-not-expand-tilde-in-parameter-expansion-in-quotes.right @@ -0,0 +1 @@ +~root diff --git a/shell/hush_test/hush-vars/var-do-not-expand-tilde-in-parameter-expansion-in-quotes.tests b/shell/hush_test/hush-vars/var-do-not-expand-tilde-in-parameter-expansion-in-quotes.tests new file mode 100755 index 000000000..d8eb8fc1b --- /dev/null +++ b/shell/hush_test/hush-vars/var-do-not-expand-tilde-in-parameter-expansion-in-quotes.tests @@ -0,0 +1,2 @@ +unset a +echo "${a:-~root}" diff --git a/shell/hush_test/hush-vars/var-do-not-quote-backslashes-in-parameter-expansions-outside-quotes.right b/shell/hush_test/hush-vars/var-do-not-quote-backslashes-in-parameter-expansions-outside-quotes.right new file mode 100644 index 000000000..030ebdeb6 --- /dev/null +++ b/shell/hush_test/hush-vars/var-do-not-quote-backslashes-in-parameter-expansions-outside-quotes.right @@ -0,0 +1 @@ +/b/c/ diff --git a/shell/hush_test/hush-vars/var-do-not-quote-backslashes-in-parameter-expansions-outside-quotes.tests b/shell/hush_test/hush-vars/var-do-not-quote-backslashes-in-parameter-expansions-outside-quotes.tests new file mode 100755 index 000000000..fb9371467 --- /dev/null +++ b/shell/hush_test/hush-vars/var-do-not-quote-backslashes-in-parameter-expansions-outside-quotes.tests @@ -0,0 +1,3 @@ +a=/b/c/* +b=\\ +echo ${a%$b*} diff --git a/shell/hush_test/hush-vars/var-pattern-replacement-in-parameter-expansion-1.right b/shell/hush_test/hush-vars/var-pattern-replacement-in-parameter-expansion-1.right new file mode 100644 index 000000000..2da327222 --- /dev/null +++ b/shell/hush_test/hush-vars/var-pattern-replacement-in-parameter-expansion-1.right @@ -0,0 +1 @@ +a_\_z_c diff --git a/shell/hush_test/hush-vars/var-pattern-replacement-in-parameter-expansion-1.tests b/shell/hush_test/hush-vars/var-pattern-replacement-in-parameter-expansion-1.tests new file mode 100755 index 000000000..e4529c631 --- /dev/null +++ b/shell/hush_test/hush-vars/var-pattern-replacement-in-parameter-expansion-1.tests @@ -0,0 +1,2 @@ +v="a\bc" +echo ${v/\\b/_\\_\z_} diff --git a/shell/hush_test/hush-vars/var-pattern-replacement-in-parameter-expansion-2.right b/shell/hush_test/hush-vars/var-pattern-replacement-in-parameter-expansion-2.right new file mode 100644 index 000000000..7447c0a04 --- /dev/null +++ b/shell/hush_test/hush-vars/var-pattern-replacement-in-parameter-expansion-2.right @@ -0,0 +1 @@ +ax/yc diff --git a/shell/hush_test/hush-vars/var-pattern-replacement-in-parameter-expansion-2.tests b/shell/hush_test/hush-vars/var-pattern-replacement-in-parameter-expansion-2.tests new file mode 100755 index 000000000..2db1db897 --- /dev/null +++ b/shell/hush_test/hush-vars/var-pattern-replacement-in-parameter-expansion-2.tests @@ -0,0 +1,2 @@ +v="abc" +echo ${v/b/x/y} diff --git a/shell/hush_test/hush-vars/var-pattern-replacement-in-parameter-expansion-3.right b/shell/hush_test/hush-vars/var-pattern-replacement-in-parameter-expansion-3.right new file mode 100644 index 000000000..5ea5ff892 --- /dev/null +++ b/shell/hush_test/hush-vars/var-pattern-replacement-in-parameter-expansion-3.right @@ -0,0 +1 @@ +axcabc diff --git a/shell/hush_test/hush-vars/var-pattern-replacement-in-parameter-expansion-3.tests b/shell/hush_test/hush-vars/var-pattern-replacement-in-parameter-expansion-3.tests new file mode 100755 index 000000000..0935e4509 --- /dev/null +++ b/shell/hush_test/hush-vars/var-pattern-replacement-in-parameter-expansion-3.tests @@ -0,0 +1,2 @@ +v="abcabc" +echo ${v/b/x} diff --git a/shell/hush_test/hush-vars/var-pattern-replacement-in-parameter-expansion-4.right b/shell/hush_test/hush-vars/var-pattern-replacement-in-parameter-expansion-4.right new file mode 100644 index 000000000..46dd750c1 --- /dev/null +++ b/shell/hush_test/hush-vars/var-pattern-replacement-in-parameter-expansion-4.right @@ -0,0 +1 @@ +axcaxc diff --git a/shell/hush_test/hush-vars/var-pattern-replacement-in-parameter-expansion-4.tests b/shell/hush_test/hush-vars/var-pattern-replacement-in-parameter-expansion-4.tests new file mode 100755 index 000000000..d8de84347 --- /dev/null +++ b/shell/hush_test/hush-vars/var-pattern-replacement-in-parameter-expansion-4.tests @@ -0,0 +1,2 @@ +v="abcabc" +echo ${v//b/x} diff --git a/shell/hush_test/hush-vars/var-pattern-replacement-in-parameter-expansion-5.right b/shell/hush_test/hush-vars/var-pattern-replacement-in-parameter-expansion-5.right new file mode 100644 index 000000000..699b27b0c --- /dev/null +++ b/shell/hush_test/hush-vars/var-pattern-replacement-in-parameter-expansion-5.right @@ -0,0 +1 @@ +axc diff --git a/shell/hush_test/hush-vars/var-pattern-replacement-in-parameter-expansion-5.tests b/shell/hush_test/hush-vars/var-pattern-replacement-in-parameter-expansion-5.tests new file mode 100755 index 000000000..552388877 --- /dev/null +++ b/shell/hush_test/hush-vars/var-pattern-replacement-in-parameter-expansion-5.tests @@ -0,0 +1,2 @@ +v="ab/c" +echo ${v/b\//x} diff --git a/shell/hush_test/hush-vars/var-runtime-quote-detection.right b/shell/hush_test/hush-vars/var-runtime-quote-detection.right new file mode 100644 index 000000000..b554d9e46 --- /dev/null +++ b/shell/hush_test/hush-vars/var-runtime-quote-detection.right @@ -0,0 +1 @@ +<> diff --git a/shell/hush_test/hush-vars/var-runtime-quote-detection.tests b/shell/hush_test/hush-vars/var-runtime-quote-detection.tests new file mode 100755 index 000000000..e570631fd --- /dev/null +++ b/shell/hush_test/hush-vars/var-runtime-quote-detection.tests @@ -0,0 +1 @@ +foo=\\ echo "<${foo#[\\]}>"