Skip to content

Commit a0be53c

Browse files
committed
expand on cfg_match! test cases
1 parent 5be7cac commit a0be53c

13 files changed

+34
-7
lines changed

src/test/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -501,9 +501,9 @@ fn format_files_find_new_files_via_cfg_match() {
501501
}
502502
}
503503
assert_eq!(
504-
3,
504+
6,
505505
write_result.len(),
506-
"Should have uncovered an extra file (format_me_please.rs) via lib.rs"
506+
"Should have uncovered an extra file (format_me_please_x.rs) via lib.rs"
507507
);
508508
assert!(handle_result(write_result, None).is_ok());
509509
});

tests/source/cfg_match/format_me_please.rs

-2
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
pub fn format_me_please_1( ) { }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
pub fn format_me_please_2( ) { }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
pub fn format_me_please_3( ) { }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
pub fn format_me_please_4( ) { }

tests/source/cfg_match/lib.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
std::cfg_match! {
2+
test => {
3+
mod format_me_please_1;
4+
}
25
target_family = "unix" => {
3-
mod format_me_please;
6+
mod format_me_please_2;
7+
}
8+
cfg(target_pointer_width = "32") => {
9+
mod format_me_please_3;
10+
}
11+
_ => {
12+
mod format_me_please_4;
413
}
514
}

tests/target/cfg_match/format_me_please.rs

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pub fn format_me_please_1() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pub fn format_me_please_2() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pub fn format_me_please_3() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pub fn format_me_please_4() {}

tests/target/cfg_match/lib.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
std::cfg_match! {
2+
test => {
3+
mod format_me_please_1;
4+
}
25
target_family = "unix" => {
3-
mod format_me_please;
6+
mod format_me_please_2;
7+
}
8+
cfg(target_pointer_width = "32") => {
9+
mod format_me_please_3;
10+
}
11+
_ => {
12+
mod format_me_please_4;
413
}
514
}

0 commit comments

Comments
 (0)