From 744a20d8f9b1baf7c8cc1ed33ec744a52c89768f Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Fri, 2 Mar 2018 17:13:22 +0100 Subject: [PATCH] shell: two new tests, both fail for ash and hush Signed-off-by: Denys Vlasenko --- shell/ash_test/ash-quoting/bkslash_in_varexp.right | 5 +++++ shell/ash_test/ash-quoting/bkslash_in_varexp.tests | 6 ++++++ shell/ash_test/ash-quoting/squote_in_varexp.right | 5 +++++ shell/ash_test/ash-quoting/squote_in_varexp.tests | 6 ++++++ shell/hush_test/hush-quoting/bkslash_in_varexp.right | 5 +++++ shell/hush_test/hush-quoting/bkslash_in_varexp.tests | 6 ++++++ shell/hush_test/hush-quoting/squote_in_varexp.right | 5 +++++ shell/hush_test/hush-quoting/squote_in_varexp.tests | 6 ++++++ 8 files changed, 44 insertions(+) create mode 100644 shell/ash_test/ash-quoting/bkslash_in_varexp.right create mode 100755 shell/ash_test/ash-quoting/bkslash_in_varexp.tests create mode 100644 shell/ash_test/ash-quoting/squote_in_varexp.right create mode 100755 shell/ash_test/ash-quoting/squote_in_varexp.tests create mode 100644 shell/hush_test/hush-quoting/bkslash_in_varexp.right create mode 100755 shell/hush_test/hush-quoting/bkslash_in_varexp.tests create mode 100644 shell/hush_test/hush-quoting/squote_in_varexp.right create mode 100755 shell/hush_test/hush-quoting/squote_in_varexp.tests diff --git a/shell/ash_test/ash-quoting/bkslash_in_varexp.right b/shell/ash_test/ash-quoting/bkslash_in_varexp.right new file mode 100644 index 000000000..d03047024 --- /dev/null +++ b/shell/ash_test/ash-quoting/bkslash_in_varexp.right @@ -0,0 +1,5 @@ +Nothing: +Nothing: +Nothing: +Nothing: +Ok:0 diff --git a/shell/ash_test/ash-quoting/bkslash_in_varexp.tests b/shell/ash_test/ash-quoting/bkslash_in_varexp.tests new file mode 100755 index 000000000..41b31ab54 --- /dev/null +++ b/shell/ash_test/ash-quoting/bkslash_in_varexp.tests @@ -0,0 +1,6 @@ +x=a +echo Nothing:${x#[a\]]} +echo Nothing:"${x#[a\]]}" +echo Nothing:${x%[a\]]} +echo Nothing:"${x%[a\]]}" +echo Ok:$? diff --git a/shell/ash_test/ash-quoting/squote_in_varexp.right b/shell/ash_test/ash-quoting/squote_in_varexp.right new file mode 100644 index 000000000..a75c0bfd6 --- /dev/null +++ b/shell/ash_test/ash-quoting/squote_in_varexp.right @@ -0,0 +1,5 @@ +z +z +y +y +Ok:0 diff --git a/shell/ash_test/ash-quoting/squote_in_varexp.tests b/shell/ash_test/ash-quoting/squote_in_varexp.tests new file mode 100755 index 000000000..a2d05a246 --- /dev/null +++ b/shell/ash_test/ash-quoting/squote_in_varexp.tests @@ -0,0 +1,6 @@ +x=yz +echo ${x#'y'} +echo "${x#'y'}" +echo ${x%'z'} +echo "${x%'z'}" +echo Ok:$? diff --git a/shell/hush_test/hush-quoting/bkslash_in_varexp.right b/shell/hush_test/hush-quoting/bkslash_in_varexp.right new file mode 100644 index 000000000..d03047024 --- /dev/null +++ b/shell/hush_test/hush-quoting/bkslash_in_varexp.right @@ -0,0 +1,5 @@ +Nothing: +Nothing: +Nothing: +Nothing: +Ok:0 diff --git a/shell/hush_test/hush-quoting/bkslash_in_varexp.tests b/shell/hush_test/hush-quoting/bkslash_in_varexp.tests new file mode 100755 index 000000000..41b31ab54 --- /dev/null +++ b/shell/hush_test/hush-quoting/bkslash_in_varexp.tests @@ -0,0 +1,6 @@ +x=a +echo Nothing:${x#[a\]]} +echo Nothing:"${x#[a\]]}" +echo Nothing:${x%[a\]]} +echo Nothing:"${x%[a\]]}" +echo Ok:$? diff --git a/shell/hush_test/hush-quoting/squote_in_varexp.right b/shell/hush_test/hush-quoting/squote_in_varexp.right new file mode 100644 index 000000000..a75c0bfd6 --- /dev/null +++ b/shell/hush_test/hush-quoting/squote_in_varexp.right @@ -0,0 +1,5 @@ +z +z +y +y +Ok:0 diff --git a/shell/hush_test/hush-quoting/squote_in_varexp.tests b/shell/hush_test/hush-quoting/squote_in_varexp.tests new file mode 100755 index 000000000..a2d05a246 --- /dev/null +++ b/shell/hush_test/hush-quoting/squote_in_varexp.tests @@ -0,0 +1,6 @@ +x=yz +echo ${x#'y'} +echo "${x#'y'}" +echo ${x%'z'} +echo "${x%'z'}" +echo Ok:$? -- 2.25.1