From 9e55cca091dfb8ce515493b344e018e7383d3672 Mon Sep 17 00:00:00 2001 From: Nick Drozd Date: Sun, 3 Dec 2023 13:47:11 -0500 Subject: [PATCH] Add long add test cases --- test/test_num.py | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/test/test_num.py b/test/test_num.py index 5035fac6..af90bbd9 100644 --- a/test/test_num.py +++ b/test/test_num.py @@ -57,10 +57,10 @@ def setUpClass(cls): @classmethod def tearDownClass(cls): assert_num_counts({ - "adds": 2258, + "adds": 2272, "divs": 2062, - "exps": 1184, - "muls": 1351, + "exps": 1187, + "muls": 1385, }) def assert_mod( @@ -286,6 +286,26 @@ def test_add(self): 54, "(2 * (3 ** 3))") + self.assert_num( + -(5 * Exp(3, 3)) + (7 * Exp(3, 3)), + 54, + "((7 * (3 ** 3)) + -(5 * (3 ** 3)))") + + self.assert_num( + -(341 * Exp(2, 53)) + (3095 * Exp(2, 53)), + 24805826747556691968, + "((3095 * (2 ** 53)) + -(341 * (2 ** 53)))") + + self.assert_num( + (7 * Exp(2, 42)) + (-(223 * Exp(2, 42)) + ((7 * Exp(2, 47)) + ((11 * Exp(2, 53)) + -(223 * Exp(2, 48))))), + 36345456367763456, + "((7 * (2 ** 42)) + (-(223 * (2 ** 42)) + ((7 * (2 ** 47)) + ((11 * (2 ** 53)) + -(223 * (2 ** 48))))))") + + self.assert_num( + -(341 * Exp(2, 53)) + ((3095 * Exp(2, 53)) + ((4227601 * Exp(2, 60)) + -(341 * Exp(2, 56)))), + 4874092339984591505850368, + "(-(341 * (2 ** 53)) + ((3095 * (2 ** 53)) + ((4227601 * (2 ** 60)) + -(341 * (2 ** 56)))))") + def test_div(self): self.assert_num( (-2 + Exp(2, 3)) // 3,