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.
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.
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/>.
16 foo) echo fallthrough ;&
19 fop) echo but not here;;
25 *bar) echo and match ;;&
26 qux) echo but not this ;;
30 a) echo no more clauses;&
37 $((x=2)) ) echo $x.$y ;;
42 case 1 in $((xx++)) ) echo hi1 ;; *) echo hi2; esac
49 [$var]*[$var]) echo matches 1;;
53 case abc in ( [] ) echo yes ;; ( * ) echo no ;; esac
55 case abc in ( ["$empty"] ) echo yes ;; ( * ) echo no ;; esac
57 case abc in ( [] | [!a-z]* ) echo yes ;; ( * ) echo no ;; esac
59 case abc in ( ["$empty"] | [!a-z]* ) echo yes ;; ( * ) echo no ;; esac
61 case abc in (["$empty"]|[!a-z]*) echo yes ;; (*) echo no ;; esac
63 case " " in ( [" "] ) echo ok;; ( * ) echo no;; esac
65 # tests of quote removal and pattern matching
66 ${THIS_SH} ./case1.sub
67 ${THIS_SH} ./case2.sub
68 ${THIS_SH} ./case3.sub
69 ${THIS_SH} ./case4.sub