Skip to content

Commit a5f621b

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

13 files changed

+38
-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

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
1+
#![feature(cfg_match)]
2+
13
std::cfg_match! {
4+
test => {
5+
mod format_me_please_1;
6+
}
27
target_family = "unix" => {
3-
mod format_me_please;
8+
mod format_me_please_2;
9+
}
10+
cfg(target_pointer_width = "32") => {
11+
mod format_me_please_3;
12+
}
13+
_ => {
14+
mod format_me_please_4;
415
}
516
}

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

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
1+
#![feature(cfg_match)]
2+
13
std::cfg_match! {
4+
test => {
5+
mod format_me_please_1;
6+
}
27
target_family = "unix" => {
3-
mod format_me_please;
8+
mod format_me_please_2;
9+
}
10+
cfg(target_pointer_width = "32") => {
11+
mod format_me_please_3;
12+
}
13+
_ => {
14+
mod format_me_please_4;
415
}
516
}

0 commit comments

Comments
 (0)