test_history_formats to adopt custom history directories

Simplifies this test by making it no longer serial.
This commit is contained in:
Peter Ammon
2026-02-07 12:23:01 -08:00
parent 8e014bbf97
commit cf0e07aecd

View File

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