From 0b4b17307ded47467845ca19b08ee1b8a2d0df87 Mon Sep 17 00:00:00 2001 From: "Jamil Lambert, PhD" Date: Thu, 19 Jun 2025 17:27:20 +0100 Subject: [PATCH] Test SignedAmount edge case to kill mutant There is a mutant found in `SignedAmount::positive_sub`. Add an edge case to the test to kill the mutant. --- units/src/amount/tests.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/units/src/amount/tests.rs b/units/src/amount/tests.rs index 1eebfe6f4..47809e460 100644 --- a/units/src/amount/tests.rs +++ b/units/src/amount/tests.rs @@ -259,6 +259,7 @@ fn checked_arithmetic() { #[test] fn positive_sub() { assert_eq!(ssat(10).positive_sub(ssat(7)).unwrap(), ssat(3)); + assert_eq!(ssat(10).positive_sub(ssat(10)).unwrap(), ssat(0)); assert!(ssat(-10).positive_sub(ssat(7)).is_none()); assert!(ssat(10).positive_sub(ssat(-7)).is_none()); assert!(ssat(10).positive_sub(ssat(11)).is_none());