From 8bb9ce3e472993f5820d9d66337343e5f956b937 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Mon, 3 Mar 2025 05:20:01 +1100 Subject: [PATCH] Add tests for amount op int We aim to support three ops on amount types that use an integer for the right hand size. Prove that implement them. --- units/src/amount/tests.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/units/src/amount/tests.rs b/units/src/amount/tests.rs index d3463660f..e021448bc 100644 --- a/units/src/amount/tests.rs +++ b/units/src/amount/tests.rs @@ -1289,6 +1289,15 @@ fn num_op_result_ops_integer() { } } check_op! { + // Operations on an amount type and an integer. + let _ = sat * 3_u64; // Explicit type for the benefit of the reader. + let _ = sat / 3; + let _ = sat % 3; + + let _ = ssat * 3_i64; // Explicit type for the benefit of the reader. + let _ = ssat / 3; + let _ = ssat % 3; + // Operations on a `NumOpResult` and integer. let _ = res * 3_u64; // Explicit type for the benefit of the reader. let _ = res / 3;