From 6dc64c8477615ffc81aec1af339f537e395bd369 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Sat, 2 Dec 2023 15:52:00 -0600 Subject: [PATCH] Dedupe test input --- 2023/rust/src/day2.rs | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/2023/rust/src/day2.rs b/2023/rust/src/day2.rs index 7245575..d8baa0d 100644 --- a/2023/rust/src/day2.rs +++ b/2023/rust/src/day2.rs @@ -97,27 +97,12 @@ mod tests { #[test] fn test() { - assert_eq!( - Day2::part1( - r#"Game 1: 3 blue, 4 red; 1 red, 2 green, 6 blue; 2 green + let input = r#"Game 1: 3 blue, 4 red; 1 red, 2 green, 6 blue; 2 green Game 2: 1 blue, 2 green; 3 green, 4 blue, 1 red; 1 green, 1 blue Game 3: 8 green, 6 blue, 20 red; 5 blue, 4 red, 13 green; 5 green, 1 red Game 4: 1 green, 3 red, 6 blue; 3 green, 6 red; 3 green, 15 blue, 14 red -Game 5: 6 red, 1 blue, 3 green; 2 blue, 1 red, 2 green"# - .into() - ), - 8 - ); - assert_eq!( - Day2::part2( - r#"Game 1: 3 blue, 4 red; 1 red, 2 green, 6 blue; 2 green -Game 2: 1 blue, 2 green; 3 green, 4 blue, 1 red; 1 green, 1 blue -Game 3: 8 green, 6 blue, 20 red; 5 blue, 4 red, 13 green; 5 green, 1 red -Game 4: 1 green, 3 red, 6 blue; 3 green, 6 red; 3 green, 15 blue, 14 red -Game 5: 6 red, 1 blue, 3 green; 2 blue, 1 red, 2 green"# - .into() - ), - 2286 - ); +Game 5: 6 red, 1 blue, 3 green; 2 blue, 1 red, 2 green"#; + assert_eq!(Day2::part1(input.into()), 8); + assert_eq!(Day2::part2(input.into()), 2286); } }