mirror of
https://github.com/rust-lang/cargo.git
synced 2025-10-01 11:30:39 +00:00
refactor(test): Move compare tests into a mod
This commit is contained in:
parent
17b52b0ca1
commit
c8113d3a1c
@ -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,
|
||||||
);
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user