Skip to content

Commit

Permalink
Add long add test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
nickdrozd committed Dec 4, 2023
1 parent 6c33821 commit 9e55cca
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions test/test_num.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 9e55cca

Please sign in to comment.