]> git.ipfire.org Git - thirdparty/glibc.git/blame - localedata/tst-rpmatch.sh
Update copyright notices with scripts/update-copyrights.
[thirdparty/glibc.git] / localedata / tst-rpmatch.sh
CommitLineData
3db52d94
UD
1#! /bin/sh -f
2#
568035b7 3# Copyright (C) 1998-2013 Free Software Foundation, Inc.
3db52d94
UD
4# This file is part of the GNU C Library and contains tests for
5# the rpmatch(3)-implementation.
6# contributed by Jochen Hein <jochen.hein@delphi.central.de>
7
8# This program is free software; you can redistribute it and/or modify
9# it under the terms of the GNU General Public License as published by
10# the Free Software Foundation; either version 2, or (at your option)
11# any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License
59ba27a6 19# along with this program; if not, see <http://www.gnu.org/licenses/>.
3db52d94 20
57c69bef
DL
21set -e
22
3db52d94 23common_objpfx=$1
9f835f5f
UD
24tst_rpmatch=$2
25
3db52d94 26rc=0
9f835f5f 27while IFS=\& read locale string result dummy; do
3db52d94
UD
28 if [ "$locale" != "#" ]; then
29 LOCPATH=${common_objpfx}localedata \
07dab0c3 30 GCONV_PATH=${common_objpfx}/iconvdata \
6fb54a22 31 ${tst_rpmatch} $locale $string $result < /dev/null \
ca41028b 32 || { echo "$locale $string $result FAILED"; exit 1; }
3db52d94
UD
33 fi
34done <<EOF
e69dbc25 35#& These are the tests for rpmatch in glibc. Each line contains one test,
49c091e5 36#& comments start with #& in the first column. The fields are separated
ca41028b 37#& by ampersand signs and contain: the locale, the string, the expected
e69dbc25
UD
38#& return value of rpmatch(3). If the test fails, test-rpmatch prints
39#& all these informations
40C&Yes&1
41C&yes&1
42C&YES&1
43C&YeS&1
44C&YEs&1
45C&yEs&1
46C&yES&1
47C&yeS&1
48C&No&0
49C&no&0
50#& Uh, that's nonsense
51C&nonsens&0
52C&Error&-1
040cf4ba
UD
53de_DE.ISO-8859-1&Yes&1
54de_DE.ISO-8859-1&Ja&1
55de_DE.ISO-8859-1&Jammerschade&1
56de_DE.ISO-8859-1&dejavu&-1
57de_DE.ISO-8859-1&Nein&0
58de_DE.ISO-8859-1&Fehler&-1
59de_DE.ISO-8859-1&jein&1
3db52d94 60EOF