diff options
author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2023-09-06 17:07:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-06 17:07:37 +0100 |
commit | 2cbd1b40cb4392b6a4f6b2e7315e610f488d66b7 (patch) | |
tree | 05b4dbb0ba40cc3c5a3dd9f94cd9cb5624187bea /cli/tools/test/mod.rs | |
parent | e0a269c23af2bccfa71d7a22506a348574be138a (diff) |
fix(test): apply filter before checking for "only" (#20389)
Diffstat (limited to 'cli/tools/test/mod.rs')
-rw-r--r-- | cli/tools/test/mod.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/cli/tools/test/mod.rs b/cli/tools/test/mod.rs index 7ab74ff7c..15f8d2597 100644 --- a/cli/tools/test/mod.rs +++ b/cli/tools/test/mod.rs @@ -464,14 +464,14 @@ pub async fn test_specifier( std::mem::take(&mut state.borrow_mut::<ops::testing::TestContainer>().0) }; let unfiltered = tests.len(); - let (only, no_only): (Vec<_>, Vec<_>) = - tests.into_iter().partition(|(d, _)| d.only); - let used_only = !only.is_empty(); - let tests = if used_only { only } else { no_only }; - let mut tests = tests + let tests = tests .into_iter() .filter(|(d, _)| options.filter.includes(&d.name)) .collect::<Vec<_>>(); + let (only, no_only): (Vec<_>, Vec<_>) = + tests.into_iter().partition(|(d, _)| d.only); + let used_only = !only.is_empty(); + let mut tests = if used_only { only } else { no_only }; if let Some(seed) = options.shuffle { tests.shuffle(&mut SmallRng::seed_from_u64(seed)); } |