From bf674dd1630e8103dc1b547c559fe0991355a06b Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Mon, 18 Mar 2024 22:33:41 +0900 Subject: [PATCH] test windows: don't use the default locale --- test/test_detect_general.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/test_detect_general.rb b/test/test_detect_general.rb index c7f7d6f..d7a65ef 100644 --- a/test/test_detect_general.rb +++ b/test/test_detect_general.rb @@ -27,6 +27,9 @@ class TestDetectGeneral < Test::Unit::TestCase def setup Locale.init Locale.clear_all + if Locale::Driver.const_defined?(:Win32) + Locale::Driver::Win32.set_thread_locale_id(0xffff) # invalid + end ENV["LC_ALL"] = nil ENV["LC_CTYPE"] = nil ENV["LC_MESSAGES"] = nil @@ -34,6 +37,12 @@ def setup ENV["LANGUAGE"] = nil end + def teardown + if Locale::Driver.const_defined?(:Win32) + Locale::Driver::Win32.set_thread_locale_id(nil) + end + end + def test_lc_all ENV["LC_ALL"] = "ja_JP.eucJP" ENV["LC_CTYPE"] = "fr_FR.ISO-8859-1" #Ignored.