refactor(test): Move compare tests into a mod

This commit is contained in:
Ed Page 2024-07-10 16:33:14 -05:00
parent 17b52b0ca1
commit c8113d3a1c

View File

@ -822,8 +822,12 @@ impl fmt::Debug for WildStr<'_> {
} }
} }
#[test] #[cfg(test)]
fn wild_str_cmp() { mod test {
use super::*;
#[test]
fn wild_str_cmp() {
for (a, b) in &[ for (a, b) in &[
("a b", "a b"), ("a b", "a b"),
("a[..]b", "a b"), ("a[..]b", "a b"),
@ -836,10 +840,10 @@ fn wild_str_cmp() {
for (a, b) in &[("[..]b", "c"), ("b", "c"), ("b", "cb")] { for (a, b) in &[("[..]b", "c"), ("b", "c"), ("b", "cb")] {
assert_ne!(WildStr::new(a), WildStr::new(b)); assert_ne!(WildStr::new(a), WildStr::new(b));
} }
} }
#[test] #[test]
fn dirty_msvc() { fn dirty_msvc() {
let case = |expected: &str, wild: &str, msvc: bool| { let case = |expected: &str, wild: &str, msvc: bool| {
assert_eq!(expected, &replace_dirty_msvc_impl(wild, msvc)); assert_eq!(expected, &replace_dirty_msvc_impl(wild, msvc));
}; };
@ -947,4 +951,5 @@ B", false,
[DIRTY-MSVC] a", [DIRTY-MSVC] a",
false, false,
); );
}
} }