From acff994611cd46e3e5657e9d63294ba75071b9db Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Mon, 5 Jan 2026 15:42:30 +0100 Subject: [PATCH] tests: use setup_test_locale helper in touch test Replace manual unsafe env::set_var + setup_localization calls with the new setup_test_locale helper function for cleaner test code. --- src/uu/touch/src/touch.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/uu/touch/src/touch.rs b/src/uu/touch/src/touch.rs index 4d1c9772c..695cc3a0d 100644 --- a/src/uu/touch/src/touch.rs +++ b/src/uu/touch/src/touch.rs @@ -911,10 +911,7 @@ mod tests { #[cfg(windows)] #[test] fn test_get_pathbuf_from_stdout_fails_if_stdout_is_not_a_file() { - unsafe { - env::set_var("LANG", "C"); - } - let _ = locale::setup_localization("touch"); + let _ = locale::setup_test_locale("touch"); // We can trigger an error by not setting stdout to anything (will // fail with code 1) assert!(