From 2d9e943bffbf071ad5d213ef2c97e3c01bc54be3 Mon Sep 17 00:00:00 2001 From: Greg Burri Date: Fri, 13 Dec 2024 16:58:15 +0100 Subject: [PATCH] Rename test functions --- src/day03.rs | 4 ++-- src/day04.rs | 4 ++-- src/day05.rs | 4 ++-- src/day06.rs | 6 +++--- src/day07.rs | 4 ++-- src/day08.rs | 4 ++-- src/day09.rs | 4 ++-- src/day10.rs | 4 ++-- src/day11.rs | 2 +- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/day03.rs b/src/day03.rs index 4a2f59d..4b183a4 100644 --- a/src/day03.rs +++ b/src/day03.rs @@ -49,7 +49,7 @@ mod tests { r#"xmul(2,4)%&mul[3,7]!@^do_not_mul(5,5)+mul(32,64]then(mul(11,8)mul(8,5))"#; #[test] - fn test_part1() { + fn part1() { let v = execute_corrupted_program(CORRUPTED_PROGRAM_PART1); assert_eq!(v, 161); } @@ -58,7 +58,7 @@ mod tests { r#"xmul(2,4)&mul[3,7]!^don't()_mul(5,5)+mul(32,64](mul(11,8)undo()?mul(8,5))"#; #[test] - fn test_part2() { + fn part2() { let v = execute_corrupted_program_dodont(CORRUPTED_PROGRAM_PART2); assert_eq!(v, 48); } diff --git a/src/day04.rs b/src/day04.rs index a92e9ac..b228168 100644 --- a/src/day04.rs +++ b/src/day04.rs @@ -114,14 +114,14 @@ MAMMMXMMMM MXMXAXMASX"; #[test] - fn test_part1() { + fn part1() { let word_search = read_word_search(&mut WORD_SEARCH.as_bytes()); let n = nb_of_word_occurences(&word_search, "XMAS"); assert_eq!(n, 18); } #[test] - fn test_part2() { + fn part2() { let word_search = read_word_search(&mut WORD_SEARCH.as_bytes()); let n = nb_of_mas_cross(&word_search); assert_eq!(n, 9); diff --git a/src/day05.rs b/src/day05.rs index 10d0915..9693975 100644 --- a/src/day05.rs +++ b/src/day05.rs @@ -131,7 +131,7 @@ mod tests { 97,13,75,29,47"; #[test] - fn test_part1() { + fn part1() { let (ordering, updates) = read_ordering_and_updates(&mut PAGE_ORDERING_AND_UPDATES.as_bytes()); let s = sum_of_mid_page_from_valid_updates(&ordering, &updates); @@ -139,7 +139,7 @@ mod tests { } #[test] - fn test_part2() { + fn part2() { let (ordering, updates) = read_ordering_and_updates(&mut PAGE_ORDERING_AND_UPDATES.as_bytes()); let s = sum_of_mid_page_from_corrected_updates(&ordering, &updates); diff --git a/src/day06.rs b/src/day06.rs index 2f771be..6c198c8 100644 --- a/src/day06.rs +++ b/src/day06.rs @@ -148,14 +148,14 @@ mod tests { ......#..."; #[test] - fn test_part1() { + fn part1() { let (map, guard_pos) = read_map(&mut MAP.as_bytes()); let n = nb_position_visited_by_guard(&map, guard_pos); assert_eq!(n, 41); } #[test] - fn test_part2() { + fn part2() { let (map, guard_pos) = read_map(&mut MAP.as_bytes()); let n = nb_possible_obstruction_position(&map, guard_pos); assert_eq!(n, 6); @@ -187,7 +187,7 @@ mod tests { .#."; #[test] - fn test_part2_tiny_maps() { + fn part2_tiny_maps() { let (map, guard_pos) = read_map(&mut MAP2.as_bytes()); assert_eq!(nb_possible_obstruction_position(&map, guard_pos), 1); diff --git a/src/day07.rs b/src/day07.rs index 05d23e1..8d03c75 100644 --- a/src/day07.rs +++ b/src/day07.rs @@ -106,14 +106,14 @@ mod tests { 292: 11 6 16 20"; #[test] - fn test_part1() { + fn part1() { let equations = read(&mut EQUATIONS.as_bytes()); let sum = sum_valid_equations(&equations); assert_eq!(sum, 3749); } #[test] - fn test_part2() { + fn part2() { let equations = read(&mut EQUATIONS.as_bytes()); let sum = sum_valid_equations_with_concat(&equations); assert_eq!(sum, 11387); diff --git a/src/day08.rs b/src/day08.rs index 00162ce..8b70448 100644 --- a/src/day08.rs +++ b/src/day08.rs @@ -119,14 +119,14 @@ mod tests { ............"; #[test] - fn test_part1() { + fn part1() { let antennae = read(&mut ANTENNAE.as_bytes()); let n = nb_antinodes(&antennae, AntinodeMode::TwoPerPair); assert_eq!(n, 14); } #[test] - fn test_part2() { + fn part2() { let antennae = read(&mut ANTENNAE.as_bytes()); let n = nb_antinodes(&antennae, AntinodeMode::Unlimited); assert_eq!(n, 34); diff --git a/src/day09.rs b/src/day09.rs index 31a23cd..7bb59f8 100644 --- a/src/day09.rs +++ b/src/day09.rs @@ -130,7 +130,7 @@ mod tests { static DISK_MAP: &str = "2333133121414131402"; #[test] - fn test_part1() { + fn part1() { let memory = read(&mut DISK_MAP.as_bytes()); let memory = defrag_v1(memory); let checksum = checksum(&memory); @@ -138,7 +138,7 @@ mod tests { } #[test] - fn test_part2() { + fn part2() { let memory = read(&mut DISK_MAP.as_bytes()); let memory = defrag_v2(memory); let checksum = checksum(&memory); diff --git a/src/day10.rs b/src/day10.rs index ca7c7f6..b28ec58 100644 --- a/src/day10.rs +++ b/src/day10.rs @@ -90,14 +90,14 @@ mod tests { 10456732"; #[test] - fn test_part1() { + fn part1() { let (map, start_positions) = read_map(&mut MAP.as_bytes()); let score = score(&map, &start_positions, false); assert_eq!(score, 36); } #[test] - fn test_part2() { + fn part2() { let (map, start_positions) = read_map(&mut MAP.as_bytes()); let score = score(&map, &start_positions, true); assert_eq!(score, 81); diff --git a/src/day11.rs b/src/day11.rs index c3e3bd1..58a059d 100644 --- a/src/day11.rs +++ b/src/day11.rs @@ -43,7 +43,7 @@ mod tests { static STONES: &str = "125 17"; #[test] - fn test_part1_and_part2() { + fn part1_and_part2() { let stones = read(&mut STONES.as_bytes()); let stones_after_6 = blink(stones.clone(), 6); let stones_after_25 = blink(stones, 25); -- 2.45.2