From 69380c6c92e1e35db6593fc4696897ac4eea63f4 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Thu, 10 Oct 2024 09:07:39 +0200 Subject: [PATCH] Remove redundant test setup One function calls setup twice, and the other one is not a test so should not be prefixed with "test_". --- src/builtins/tests/string_tests.rs | 2 -- src/tests/history.rs | 5 ++--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/builtins/tests/string_tests.rs b/src/builtins/tests/string_tests.rs index d44357d64..828abe85d 100644 --- a/src/builtins/tests/string_tests.rs +++ b/src/builtins/tests/string_tests.rs @@ -14,8 +14,6 @@ fn test_string() { use crate::tests::prelude::*; use crate::wchar::prelude::*; - let _cleanup = test_init(); - // avoid 1.3k L!()'s macro_rules! test_cases { ([$($x:expr),*], $rc:expr, $out:expr) => { (vec![$(L!($x)),*], $rc, L!($out)) }; diff --git a/src/tests/history.rs b/src/tests/history.rs index 503fd990e..4de19092f 100644 --- a/src/tests/history.rs +++ b/src/tests/history.rs @@ -227,8 +227,7 @@ fn generate_history_lines(item_count: usize, idx: usize) -> Vec { result } -fn test_history_races_pound_on_history(item_count: usize, idx: usize) { - let _cleanup = test_init(); +fn pound_on_history(item_count: usize, idx: usize) { // Called in child thread to modify history. let hist = History::new(L!("race_test")); let hist_lines = generate_history_lines(item_count, idx); @@ -272,7 +271,7 @@ fn test_history_races() { let mut children = Vec::with_capacity(RACE_COUNT); for i in 0..RACE_COUNT { children.push(std::thread::spawn(move || { - test_history_races_pound_on_history(ITEM_COUNT, i); + pound_on_history(ITEM_COUNT, i); })); }