]>
Commit | Line | Data |
---|---|---|
deb63bfb | 1 | # $FreeBSD: head/bin/sh/tests/builtins/case5.0 221646 2011-05-08 11:32:20Z jilles $ |
71aad674 A |
2 | |
3 | unset LC_ALL | |
4 | LC_CTYPE=en_US.UTF-8 | |
5 | export LC_CTYPE | |
6 | ||
7 | c1=e | |
8 | # a umlaut | |
9 | c2=$(printf '\303\244') | |
10 | # euro sign | |
11 | c3=$(printf '\342\202\254') | |
12 | # some sort of 't' outside BMP | |
13 | c4=$(printf '\360\235\225\245') | |
14 | ||
15 | ok=0 | |
16 | case $c1$c2$c3$c4 in | |
17 | *) ok=1 ;; | |
18 | esac | |
19 | if [ $ok = 0 ]; then | |
20 | echo wrong at $LINENO | |
21 | exit 3 | |
22 | fi | |
23 | ||
24 | case $c1$c2$c3$c4 in | |
25 | $c1$c2$c3$c4) ;; | |
26 | *) echo wrong at $LINENO ;; | |
27 | esac | |
28 | ||
29 | case $c1$c2$c3$c4 in | |
30 | "$c1$c2$c3$c4") ;; | |
31 | *) echo wrong at $LINENO ;; | |
32 | esac | |
33 | ||
34 | case $c1$c2$c3$c4 in | |
35 | ????) ;; | |
36 | *) echo wrong at $LINENO ;; | |
37 | esac | |
38 | ||
39 | case $c1.$c2.$c3.$c4 in | |
40 | ?.?.?.?) ;; | |
41 | *) echo wrong at $LINENO ;; | |
42 | esac | |
43 | ||
44 | case $c1$c2$c3$c4 in | |
45 | [!a][!b][!c][!d]) ;; | |
46 | *) echo wrong at $LINENO ;; | |
47 | esac | |
48 | ||
49 | case $c1$c2$c3$c4 in | |
50 | [$c1][$c2][$c3][$c4]) ;; | |
51 | *) echo wrong at $LINENO ;; | |
52 | esac | |
53 | ||
54 | case $c1$c2$c3$c4 in | |
55 | ["$c1"]["$c2"]["$c3"]["$c4"]) ;; | |
56 | *) echo wrong at $LINENO ;; | |
57 | esac |