rename parse param to bench_parse

This commit is contained in:
kageru 2022-11-29 12:56:07 +01:00
parent a6dfde6fc5
commit 22afa80e1b
2 changed files with 8 additions and 10 deletions

View File

@ -21,7 +21,7 @@ boilerplate! {
}, },
bench1 == 731731, bench1 == 731731,
bench2 == 116115990, bench2 == 116115990,
parse: Vec::len => 200, bench_parse: Vec::len => 200,
} }
/// Naive solution for a previous day 1, /// Naive solution for a previous day 1,

View File

@ -7,7 +7,7 @@ macro_rules! boilerplate {
}, },
bench1 == $b1: literal, bench1 == $b1: literal,
bench2 == $b2: literal, bench2 == $b2: literal,
parse: $input_fn: expr => $it: literal$(,)? bench_parse: $input_fn: expr => $it: literal$(,)?
) => { ) => {
fn main() { fn main() {
let input = parse_input(&read_file(DAY)); let input = parse_input(&read_file(DAY));
@ -22,15 +22,13 @@ macro_rules! boilerplate {
const TEST_INPUT: &str = $ti; const TEST_INPUT: &str = $ti;
$($( $($(paste::paste! {
paste::paste! { #[test]
#[test] fn [<$part _test_ $to>]() {
fn [<$part _test_ $to>]() { let input = parse_input($tpi);
let input = parse_input($tpi); assert_eq!($part(&input), $to);
assert_eq!($part(&input), $to);
}
} }
)+)* })+)*
bench!(part1() == $b1); bench!(part1() == $b1);
bench!(part2() == $b2); bench!(part2() == $b2);
#[bench] #[bench]