1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-02-27 09:35:58 +02:00
Files
coreutils/tests/misc/join-utf8.sh
Bruno Haible f2e70e2d19 join: avoid test failure on systems with no French UTF-8 locale
* tests/misc/join-utf8.sh: Test the value of LOCALE_FR_UTF8 against
'none', not against a missing value.
Fixes https://bugs.gnu.org/69418
2024-02-27 14:26:35 +00:00

54 lines
1.5 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/sh
# Test join in a UTF-8 locale.
# Copyright 2023-2024 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ join
test "$LOCALE_FR_UTF8" != none || skip_ "French UTF-8 locale not available"
LC_ALL=$LOCALE_FR_UTF8
export LC_ALL
vertical_line='|'
multiplication_sign='×'
en_dash=''
old_Persian_word_divider='𐏐'
tflag=
for s in \
' ' \
"$vertical_line" \
"$multiplication_sign" \
"$en_dash" \
"$old_Persian_word_divider"
do
printf '0%sA\n1%sa\n2%sb\n4%sc\n' "$s" "$s" "$s" "$s" >a ||
framework_failure_
printf '0%sB\n1%sd\n3%se\n4%s\0f\n' "$s" "$s" "$s" "$s" >b ||
framework_failure_
join $tflag$s -a1 -a2 -eouch -o0,1.2,2.2 a b >out || fail=1
tflag=-t
printf '0%sA%sB\n1%sa%sd\n2%sb%souch\n3%souch%se\n4%sc%s\0f\n' \
"$s" "$s" "$s" "$s" "$s" "$s" "$s" "$s" "$s" "$s" >exp ||
framework_failure_
compare exp out || fail=1
done
Exit $fail