mirror of
https://github.com/nushell/nushell.git
synced 2025-03-13 06:58:47 +01:00
Use one locale for tests on all systems
This commit is contained in:
parent
71a70c75c1
commit
22a7ec5125
@ -22,9 +22,16 @@ pub fn get_system_locale() -> Locale {
|
||||
|
||||
#[cfg(debug_assertions)]
|
||||
pub fn get_system_locale_string() -> Option<String> {
|
||||
std::env::var(LOCALE_OVERRIDE_ENV_VAR)
|
||||
.ok()
|
||||
.or_else(sys_locale::get_locale)
|
||||
std::env::var(LOCALE_OVERRIDE_ENV_VAR).ok().or_else(
|
||||
#[cfg(not(test))]
|
||||
{
|
||||
sys_locale::get_locale
|
||||
},
|
||||
#[cfg(test)]
|
||||
{
|
||||
|| Some(Locale::en_US_POSIX.name().to_owned())
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
#[cfg(not(debug_assertions))]
|
||||
|
Loading…
Reference in New Issue
Block a user