Blame localedata/tst-rpmatch.sh

Packit 6c4009
#!/bin/sh -f
Packit 6c4009
#
Packit 6c4009
# Copyright (C) 1998-2018 Free Software Foundation, Inc.
Packit 6c4009
# This file is part of the GNU C Library and contains tests for
Packit 6c4009
# the rpmatch(3)-implementation.
Packit 6c4009
# contributed by Jochen Hein <jochen.hein@delphi.central.de>
Packit 6c4009
Packit 6c4009
# This program is free software; you can redistribute it and/or modify
Packit 6c4009
# it under the terms of the GNU General Public License as published by
Packit 6c4009
# the Free Software Foundation; either version 2, or (at your option)
Packit 6c4009
# any later version.
Packit 6c4009
#
Packit 6c4009
# This program is distributed in the hope that it will be useful,
Packit 6c4009
# but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 6c4009
# GNU General Public License for more details.
Packit 6c4009
#
Packit 6c4009
# You should have received a copy of the GNU General Public License
Packit 6c4009
# along with this program; if not, see <http://www.gnu.org/licenses/>.
Packit 6c4009
Packit 6c4009
set -e
Packit 6c4009
Packit 6c4009
common_objpfx=$1
Packit 6c4009
tst_rpmatch=$2
Packit 6c4009
Packit 6c4009
rc=0
Packit 6c4009
while IFS=\& read locale string result dummy; do
Packit 6c4009
    if [ "$locale" != "#" ]; then
Packit 6c4009
	${tst_rpmatch} $locale $string $result < /dev/null \
Packit 6c4009
	|| { echo "$locale $string $result  FAILED"; exit 1; }
Packit 6c4009
    fi
Packit 6c4009
done <
Packit 6c4009
#& These are the tests for rpmatch in glibc.  Each line contains one test,
Packit 6c4009
#& comments start with #& in the first column.  The fields are separated
Packit 6c4009
#& by ampersand signs and contain: the locale, the string, the expected
Packit 6c4009
#& return value of rpmatch(3).  If the test fails, test-rpmatch prints
Packit 6c4009
#& all these informations
Packit 6c4009
C&Yes&1
Packit 6c4009
C&yes&1
Packit 6c4009
C&YES&1
Packit 6c4009
C&YeS&1
Packit 6c4009
C&YEs&1
Packit 6c4009
C&yEs&1
Packit 6c4009
C&yES&1
Packit 6c4009
C&yeS&1
Packit 6c4009
C&No&0
Packit 6c4009
C&no&0
Packit 6c4009
#& Uh, that's nonsense
Packit 6c4009
C&nonsens&0
Packit 6c4009
C&Error&-1
Packit 6c4009
de_DE.ISO-8859-1&Yes&1
Packit 6c4009
de_DE.ISO-8859-1&Ja&1
Packit 6c4009
de_DE.ISO-8859-1&Jammerschade&1
Packit 6c4009
de_DE.ISO-8859-1&dejavu&-1
Packit 6c4009
de_DE.ISO-8859-1&Nein&0
Packit 6c4009
de_DE.ISO-8859-1&Fehler&-1
Packit 6c4009
de_DE.ISO-8859-1&jein&1
Packit 6c4009
EOF