Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
fmeum committed Nov 11, 2024
1 parent 488efbd commit 5a3dcff
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/test/shell/bazel/unicode_filenames_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ ls_srcs = rule(
EOF
}

function has_iso_8859_1_locale() {
charmap="$(LC_ALL=en_US.ISO-8859-1 locale charmap 2>/dev/null)"
[[ "${charmap}" == "ISO-8859-1" ]]
}

function test_utf8_source_artifact() {
unicode_filenames_test_setup

Expand Down Expand Up @@ -124,6 +129,15 @@ function test_traditional_encoding_source_artifact() {
;;
esac

# Bazel relies on the JVM for filename encoding, and can only support
# traditional encodings if it can roundtrip through ISO-8859-1.
if ! has_iso_8859_1_locale; then
echo "Skipping test (no ISO-8859-1 locale)."
echo "Available locales (need en_US.ISO-8859-1):"
locale -a
return
fi

unicode_filenames_test_setup

# >>> u"pkg/srcs/TRADITIONAL ünïcödë fïlë.txt".encode("iso-8859-1")
Expand Down

0 comments on commit 5a3dcff

Please sign in to comment.