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());