From 97c9115c02b05f9aa0120b84deffed8b7b3d6018 Mon Sep 17 00:00:00 2001 From: Miloslav Trmač Date: Sat, 2 Mar 2019 06:36:44 +0100 Subject: Potentially breaking: Make hooks sort order locale-independent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Don't sort OCI hooks using the locale collation order; it does not make sense for the same system-wide directory to be interpreted differently depending on the user's LC_COLLATE setting, and the language-specific collation order can even change over time. Besides, the current collation order determination code has never worked with the most common LC_COLLATE values like en_US.UTF-8. Ideally, we would like to just order based on Unicode code points to be reliably stable, but the existing implementation is case-insensitive, so we are forced to rely on the unicode case mapping tables at least. (This gives up on canonicalization and width-insensitivity, potentially breaking users who rely on these previously documented properties.) Signed-off-by: Miloslav Trmač --- libpod/container_internal_test.go | 48 --------------------------------------- 1 file changed, 48 deletions(-) (limited to 'libpod/container_internal_test.go') diff --git a/libpod/container_internal_test.go b/libpod/container_internal_test.go index 1654af929..f1e2b70a7 100644 --- a/libpod/container_internal_test.go +++ b/libpod/container_internal_test.go @@ -17,54 +17,6 @@ import ( // hookPath is the path to an example hook executable. var hookPath string -func TestLocaleToLanguage(t *testing.T) { - for _, testCase := range []struct { - locale string - language string - }{ - { - locale: "", - language: "und-u-va-posix", - }, - { - locale: "C", - language: "und-u-va-posix", - }, - { - locale: "POSIX", - language: "und-u-va-posix", - }, - { - locale: "c", - language: "und-u-va-posix", - }, - { - locale: "en", - language: "en", - }, - { - locale: "en_US", - language: "en-US", - }, - { - locale: "en.UTF-8", - language: "en", - }, - { - locale: "en_US.UTF-8", - language: "en-US", - }, - { - locale: "does-not-exist", - language: "does-not-exist", - }, - } { - t.Run(testCase.locale, func(t *testing.T) { - assert.Equal(t, testCase.language, localeToLanguage(testCase.locale)) - }) - } -} - func TestPostDeleteHooks(t *testing.T) { ctx := context.Background() dir, err := ioutil.TempDir("", "libpod_test_") -- cgit v1.2.3-54-g00ecf