From a111ea482b663fcddfa71945bc6077b95da91400 Mon Sep 17 00:00:00 2001 From: Beefki Date: Thu, 2 Nov 2017 11:44:41 -0500 Subject: [PATCH] Fixed tests to run again --- src/roll.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/roll.rs b/src/roll.rs index 1f43939..f515124 100644 --- a/src/roll.rs +++ b/src/roll.rs @@ -123,7 +123,7 @@ fn displays() { #[test] fn rolls() { let x = Roll::new(20, 6); - for y in x.rolls() { + for y in x.clone().rolls() { assert!(y <= x.die()); } } @@ -131,8 +131,10 @@ fn rolls() { fn totaling() { for _ in 0..21 { let x = Roll::new(2, 6); - assert!(x.total() <= 12 && x.total() >= 2); - let y = Roll::new(3, 20); - assert!(y.total() <= 60 && y.total() >= 3); + let y = x.total(); + assert!(y <= 12 && y >= 2); + let z = Roll::new(3, 20); + let y = z.total(); + assert!(y <= 60_usize && y >= 3_usize); } }