From cf0e07aecde243107c7c092e78b69552f3f3ebda Mon Sep 17 00:00:00 2001 From: Peter Ammon Date: Sat, 7 Feb 2026 12:23:01 -0800 Subject: [PATCH] test_history_formats to adopt custom history directories Simplifies this test by making it no longer serial. --- src/history/history.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/history/history.rs b/src/history/history.rs index dc310aee5..0ee456455 100644 --- a/src/history/history.rs +++ b/src/history/history.rs @@ -1848,9 +1848,10 @@ fn random_string(rng: &mut ThreadRng) -> WString { } #[test] - #[serial] fn test_history() { - let _cleanup = test_init(); + let tmpdir = fish_tempfile::new_dir().unwrap(); + let hist_dir = Some(osstr2wcstring(tmpdir.path())); + macro_rules! test_history_matches { ($search:expr, $expected:expr) => { let expected: Vec<&wstr> = $expected; @@ -1877,7 +1878,7 @@ macro_rules! test_history_matches { let nocase = SearchFlags::IGNORE_CASE; // Populate a history. - let history = History::with_name(L!("test_history")); + let history = History::new(L!("test_history"), hist_dir); history.clear(); for s in items { history.add_commandline(s.to_owned());