]> git.ipfire.org Git - thirdparty/bash.git/blob - tests/case2.sub
Bash-5.2-rc4 release
[thirdparty/bash.git] / tests / case2.sub
1 # This program is free software: you can redistribute it and/or modify
2 # it under the terms of the GNU General Public License as published by
3 # the Free Software Foundation, either version 3 of the License, or
4 # (at your option) any later version.
5 #
6 # This program is distributed in the hope that it will be useful,
7 # but WITHOUT ANY WARRANTY; without even the implied warranty of
8 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 # GNU General Public License for more details.
10 #
11 # You should have received a copy of the GNU General Public License
12 # along with this program. If not, see <http://www.gnu.org/licenses/>.
13 #
14 x=$'\\a\\b\\c\\\001\\d\\e\\f'
15 y='\a\b\c\\ 1\d\e\f'
16 z=$'abc\001def'
17
18 recho "$x"
19 recho "$y"
20 recho "$z"
21
22 case $'abc\001def' in
23 $x) echo ok 1 ;;
24 *) echo oops 1;;
25 esac
26
27 case $z in
28 $x) echo ok 2 ;;
29 *) echo oops 2;;
30 esac
31
32 case $'abc\001def' in
33 $y) echo ok 3 ;;
34 *) echo oops 3;;
35 esac
36
37 case $z in
38 $y) echo ok 4 ;;
39 *) echo oops 4;;
40 esac
41
42 # no backslash before \001
43 x=$'\\a\\b\\c\001\\d\\e\\f'
44 y='\a\b\c\ 1\d\e\f'
45
46 case $'abc\001def' in
47 $x) echo ok 5 ;;
48 *) echo oops 5;;
49 esac
50
51 case $z in
52 $x) echo ok 6 ;;
53 *) echo oops 6;;
54 esac
55
56 case $'abc\001def' in
57 $y) echo ok 7 ;;
58 *) echo oops 7;;
59 esac
60
61 case $z in
62 $y) echo ok 8 ;;
63 *) echo oops 8;;
64 esac
65