Skip to content

Commit

Permalink
Replace with macros as suggested by @oflatt
Browse files Browse the repository at this point in the history
  • Loading branch information
TrevorHansen committed Dec 29, 2023
1 parent f7a3a54 commit 556272c
Showing 1 changed file with 10 additions and 37 deletions.
47 changes: 10 additions & 37 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,42 +265,15 @@ fn check_assert_enabled() {
assert!(false);
}

// Make several identical functions so they'll be run in parallel
#[test]
fn check0() {
check_optimal_results();
}

#[test]
fn check1() {
check_optimal_results();
}

#[test]
fn check2() {
check_optimal_results();
}

#[test]
fn check3() {
check_optimal_results();
}

#[test]
fn check4() {
check_optimal_results();
}
#[test]
fn check5() {
check_optimal_results();
}

#[test]
fn check6() {
check_optimal_results();
macro_rules! create_optimal_check_tests {
($($name:ident),*) => {
$(
#[test]
fn $name() {
check_optimal_results();
}
)*
}
}

#[test]
fn check7() {
check_optimal_results();
}
create_optimal_check_tests!(check0, check1, check2, check3, check4, check5, check6, check7);

0 comments on commit 556272c

Please sign in to comment.