From 24c921425c617ae7cbbb146456ee64b9e103bb7a Mon Sep 17 00:00:00 2001 From: Ian Clester Date: Sat, 10 Sep 2022 13:13:39 -0400 Subject: [PATCH] Add another case to formatting test. --- agb-fixnum/src/lib.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/agb-fixnum/src/lib.rs b/agb-fixnum/src/lib.rs index 355b6007..1d3013d1 100644 --- a/agb-fixnum/src/lib.rs +++ b/agb-fixnum/src/lib.rs @@ -1033,15 +1033,17 @@ mod tests { #[test] fn formats_fractions_correctly() { let a = Num::::new(5); - let two = Num::::new(4); + let four = Num::::new(4); let minus_one = Num::::new(-1); - let b: Num = a / two; + let b: Num = a / four; let c: Num = b * minus_one; + let d: Num = minus_one / four; assert_eq!(b + c, 0.into()); assert_eq!(format!("{}", b), "1.25"); assert_eq!(format!("{}", c), "-1.25"); + assert_eq!(format!("{}", d), "-0.25"); } #[test]