blob: 42872cedd61546acb3f07d0a872ebbe2e4ab7684 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001#! /bin/sh -f
2#
3# Copyright (C) 1998-2015 Free Software Foundation, Inc.
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
19# along with this program; if not, see <http://www.gnu.org/licenses/>.
20
21set -e
22
23common_objpfx=$1
24tst_rpmatch=$2
25
26rc=0
27while IFS=\& read locale string result dummy; do
28 if [ "$locale" != "#" ]; then
29 ${tst_rpmatch} $locale $string $result < /dev/null \
30 || { echo "$locale $string $result FAILED"; exit 1; }
31 fi
32done <<EOF
33#& These are the tests for rpmatch in glibc. Each line contains one test,
34#& comments start with #& in the first column. The fields are separated
35#& by ampersand signs and contain: the locale, the string, the expected
36#& return value of rpmatch(3). If the test fails, test-rpmatch prints
37#& all these informations
38C&Yes&1
39C&yes&1
40C&YES&1
41C&YeS&1
42C&YEs&1
43C&yEs&1
44C&yES&1
45C&yeS&1
46C&No&0
47C&no&0
48#& Uh, that's nonsense
49C&nonsens&0
50C&Error&-1
51de_DE.ISO-8859-1&Yes&1
52de_DE.ISO-8859-1&Ja&1
53de_DE.ISO-8859-1&Jammerschade&1
54de_DE.ISO-8859-1&dejavu&-1
55de_DE.ISO-8859-1&Nein&0
56de_DE.ISO-8859-1&Fehler&-1
57de_DE.ISO-8859-1&jein&1
58EOF