From dcda4bc1c8ab79930fc8449393336cd642011a37 Mon Sep 17 00:00:00 2001 From: Alpha Chen Date: Sun, 17 Jan 2016 20:42:59 -0800 Subject: [PATCH] [rust][7.0] Clean up Circuit test --- rust/src/day_07.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rust/src/day_07.rs b/rust/src/day_07.rs index 98b0570..956cf8a 100644 --- a/rust/src/day_07.rs +++ b/rust/src/day_07.rs @@ -24,10 +24,10 @@ pub fn solve(input: &str, wire: &str) -> u16 { #[test] fn test_circuit() { let circuit = Circuit::new("123 -> x\nx -> y\nNOT x -> h"); - assert_eq!(Some(&Signal::Value(123)), circuit.connections.get(&Wire("x"))); - assert_eq!(Some(&Signal::Wire(Wire("x"))), circuit.connections.get(&Wire("y"))); - assert_eq!(Some(&Signal::Wire(Wire("x"))), circuit.connections.get(&Wire("y"))); - assert_eq!(Some(&Signal::Gate(Gate::Not(Wire("x")))), circuit.connections.get(&Wire("h"))); + assert_eq!(Signal::Value(123), circuit.connections[&Wire("x")]); + assert_eq!(Signal::Wire(Wire("x")), circuit.connections[&Wire("y")]); + assert_eq!(Signal::Wire(Wire("x")), circuit.connections[&Wire("y")]); + assert_eq!(Signal::Gate(Gate::Not(Wire("x"))), circuit.connections[&Wire("h")]); } struct Circuit<'a> {