From c2e77b5f5226f759a6303d429eb419d071f8af54 Mon Sep 17 00:00:00 2001 From: Sam M W Date: Sun, 23 Oct 2022 07:04:15 +0100 Subject: [PATCH] also test subtractions --- src/cpu.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/cpu.rs b/src/cpu.rs index e64aed1..69366c1 100644 --- a/src/cpu.rs +++ b/src/cpu.rs @@ -845,6 +845,11 @@ mod tests { assert_eq!(cpu.registers.accumulator, -128); cpu.add_with_carry(-128); assert_eq!(cpu.registers.accumulator, 0); + + cpu.subtract_with_carry(-128); + assert_eq!(cpu.registers.accumulator, -128); + cpu.subtract_with_carry(-128); + assert_eq!(cpu.registers.accumulator, 0); } #[cfg_attr(feature = "decimal_mode", test)]