diff options
author | Denys Vlasenko | 2016-10-03 00:06:55 +0200 |
---|---|---|
committer | Denys Vlasenko | 2016-10-03 00:06:55 +0200 |
commit | a62bc80571eae6d286aed9a92d47dc42318a8146 (patch) | |
tree | 45ce124c7a8426ebf95c07a34c3c521595e400de /shell/ash_test/ash-misc/case1.tests | |
parent | ce332a23a3ff45a5aeb3e737da15b469badd5d12 (diff) | |
download | busybox-a62bc80571eae6d286aed9a92d47dc42318a8146.zip busybox-a62bc80571eae6d286aed9a92d47dc42318a8146.tar.gz |
ash testsuite: add most of hust tests which pass for ash
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/ash_test/ash-misc/case1.tests')
-rwxr-xr-x | shell/ash_test/ash-misc/case1.tests | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/shell/ash_test/ash-misc/case1.tests b/shell/ash_test/ash-misc/case1.tests new file mode 100755 index 0000000..d72b57f --- /dev/null +++ b/shell/ash_test/ash-misc/case1.tests @@ -0,0 +1,40 @@ +case w in a) echo SKIP;; w) echo OK_1;; w) echo WRONG;; esac + +case w in + a) echo SKIP;; + w)echo OK_1 ;; + w) + echo WRONG + ;; +esac + +t=w +case $t in a) echo SKIP;; w) echo OK_21;; w) echo WRONG;; esac; +case "$t" in a) echo SKIP;; w) echo OK_22;; w) echo WRONG;; esac; +case w in a) echo SKIP;; $t) echo OK_23;; "$t") echo WRONG;; esac; + +case '' in a) echo SKIP;; w) echo WRONG;; *) echo OK_31;; esac; +case '' in a) echo SKIP;; '') echo OK_32;; *) echo WRONG;; esac; + +case `echo w` in a) echo SKIP;; w) echo OK_41;; w) echo WRONG;; esac; +case "`echo w`" in a) echo SKIP;; w) echo OK_42;; w) echo WRONG;; esac; +case `echo w w` in a) echo SKIP;; w) echo WRONG;; 'w w') echo OK_43;; esac; +case `echo w w` in a) echo SKIP;; w) echo WRONG;; w*) echo OK_44;; esac; + +case w in `echo w`) echo OK_51;; `echo WRONG >&2`w) echo WRONG;; esac; +case w in `echo OK_52 >&2`) echo SKIP;; `echo`w) echo OK_53;; esac; + +# parsing cases in subshells can easily get messy + case m in m) echo OK_sub1;; esac + case m in (m) echo OK_sub2;; esac +(case m in m) echo OK_sub3;; esac) +(case m in (m) echo OK_sub4;; esac) +( + case m in m) echo OK_sub5;; esac +) +( + case m in (m) echo OK_sub6;; esac +) +(case esac in "esac") echo OK_esac1;; esac) + +echo Done |