From 19536d7deece0f24d3ef09a25112a4c1932b7986 Mon Sep 17 00:00:00 2001 From: Alpha Chen Date: Fri, 15 Jan 2016 20:40:32 -0800 Subject: [PATCH] [rust] Update Day 6.0 tests --- rust/src/day_06.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/rust/src/day_06.rs b/rust/src/day_06.rs index f0879ea..61b494f 100644 --- a/rust/src/day_06.rs +++ b/rust/src/day_06.rs @@ -19,9 +19,14 @@ pub fn solve(input: &str) -> i32 { #[test] fn test_solve() { - assert_eq!(1_000_000, solve("turn on 0,0 through 999,999")); - assert_eq!(3_996, solve("turn on 0,0 through 999,999\nturn off 1,1 through 998,998")); - assert_eq!(3_996, solve("turn on 0,0 through 999,999\ntoggle 1,1 through 998,998")); + let mut input = vec!["turn on 0,0 through 999,999"]; + assert_eq!(1_000_000, solve(&input.join("\n"))); + + input.push("turn off 1,1 through 998,998"); + assert_eq!(3_996, solve(&input.join("\n"))); + + input.push("toggle 2,2 through 997,997"); + assert_eq!(996012, solve(&input.join("\n"))); } struct LightGrid {