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/>.
21 ( $2,"$2" ) printf ok2 ;;
29 ( ,"$2" ) printf ok4 ;;
33 ( $2,"$2" ) printf ok5 ;;
39 for c in $'\1' $'\2' $'\177'; do
40 echo -n "--- testing: "
41 echo "$c" | od -t a | awk 'NR==1 { print $2 } '
42 testmatch "${c}" "\\${c}"
43 testmatch "${c}x" "\\${c}\\x" # bush-git fails case 2 and 5 for $'\1'
44 testmatch "${c}x" "${c}\\x"
45 testmatch "${c}x" "${c}x"
46 testmatch "${c}x" "\\${c}x"
47 testmatch "x${c}" "\\x\\${c}"
48 testmatch "x${c}" "x\\${c}"
51 match() { case $1 in ( $2 ) ;; ( * ) return 1 ;; esac; }
52 match $'? *x\1y\177z' $'??\\*\\x\\\1\\y\\\177\\z' || echo bad 6