From db1dccc762daf69b9c294dd655aa82cf2f59e4d8 Mon Sep 17 00:00:00 2001 From: Yash Thakur <45539777+ysthakur@users.noreply.github.com> Date: Sat, 6 Apr 2024 18:01:16 -0400 Subject: [PATCH] Don't check if stderr empty in test_xdg_config_symlink (#12435) # Description Fixes a problem introduced in https://github.com/nushell/nushell/pull/12420 where one of the config path tests (`test_xdg_config_symlink`) fails if, on MacOS, a developer already has config files in the default location for that platform. This happened because the test is making sure the `xdg_config_home_invalid` error isn't reported, but to do that, it asserts that stderr is empty, which it is not if in the case mentioned above, because Nushell warns that the default location (`~/.config`/`~/Library/Application Support`) is not empty but `XDG_CONFIG_HOME` is empty. If someone with a Mac could test this, that'd be great. # User-Facing Changes None, this is for contributors. # Tests + Formatting # After Submitting --- src/tests/test_config_path.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/tests/test_config_path.rs b/src/tests/test_config_path.rs index 620ad6a48d..a8579c8bc0 100644 --- a/src/tests/test_config_path.rs +++ b/src/tests/test_config_path.rs @@ -278,6 +278,10 @@ fn test_xdg_config_symlink() { playground.symlink("real", config_link); let stderr = run_interactive_stderr(playground.cwd().join(config_link)); - assert!(stderr.is_empty(), "stderr was {}", stderr); + assert!( + !stderr.contains("xdg_config_home_invalid"), + "stderr was {}", + stderr + ); }); }