mirror of
https://github.com/nushell/nushell.git
synced 2025-03-15 16:08:34 +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)]
|
#[cfg(debug_assertions)]
|
||||||
pub fn get_system_locale_string() -> Option<String> {
|
pub fn get_system_locale_string() -> Option<String> {
|
||||||
std::env::var(LOCALE_OVERRIDE_ENV_VAR)
|
std::env::var(LOCALE_OVERRIDE_ENV_VAR).ok().or_else(
|
||||||
.ok()
|
#[cfg(not(test))]
|
||||||
.or_else(sys_locale::get_locale)
|
{
|
||||||
|
sys_locale::get_locale
|
||||||
|
},
|
||||||
|
#[cfg(test)]
|
||||||
|
{
|
||||||
|
|| Some(Locale::en_US_POSIX.name().to_owned())
|
||||||
|
},
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(debug_assertions))]
|
#[cfg(not(debug_assertions))]
|
||||||
|
Loading…
Reference in New Issue
Block a user