gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libeufin] 01/02: testing zero-check for amounts


From: gnunet
Subject: [libeufin] 01/02: testing zero-check for amounts
Date: Tue, 04 Apr 2023 21:08:34 +0200

This is an automated email from the git hooks/post-receive script.

ms pushed a commit to branch master
in repository libeufin.

commit 4990150b3aac8066c0cdee4c7dc9170e433e73c9
Author: MS <ms@taler.net>
AuthorDate: Tue Apr 4 19:18:43 2023 +0200

    testing zero-check for amounts
---
 util/src/test/kotlin/AmountTest.kt | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/util/src/test/kotlin/AmountTest.kt 
b/util/src/test/kotlin/AmountTest.kt
index 5ae1e05f..eb7d8493 100644
--- a/util/src/test/kotlin/AmountTest.kt
+++ b/util/src/test/kotlin/AmountTest.kt
@@ -19,8 +19,12 @@ inline fun <reified ExceptionType> assertException(block: () 
-> Unit) {
 class AmountTest {
     @Test
     fun equalTest() {
-        val z = BigDecimal("-0000000000.0000000000")
-        assert(isAmountZero(z))
+        assert(isAmountZero(BigDecimal("-0000000000.0000000000")))
+        assert(!isAmountZero(BigDecimal("1")))
+        assert(isAmountZero(BigDecimal("0.00")))
+        assert(isAmountZero(BigDecimal("0")))
+        assert(!isAmountZero(BigDecimal("00000000000001")))
+        assert(!isAmountZero(BigDecimal("-1.00000000")))
     }
 
     @Test

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]