Skip to content

Commit

Permalink
Update math_test.cairo (#7192)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmytroheknt authored Feb 1, 2025
1 parent b3bb598 commit 99f0528
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions corelib/src/test/math_test.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,15 @@ fn test_u256_div_mod_n() {

#[test]
fn test_u256_inv_mod() {
assert(math::u256_inv_mod(5, 24).unwrap().into() == 5_u256, 'inv_mov(5, 24) != 5');
assert(math::u256_inv_mod(29, 24).unwrap().into() == 5_u256, 'inv_mov(29, 24) != 5');
assert(math::u256_inv_mod(1, 24).unwrap().into() == 1_u256, 'inv_mov(1, 24) != 1');
assert(math::u256_inv_mod(1, 5).unwrap().into() == 1_u256, 'inv_mov(1, 5) != 1');
assert(math::u256_inv_mod(8, 24).is_none(), 'inv_mov(8, 24) != None');
assert(math::u256_inv_mod(1, 1).is_none(), 'inv_mov(1, 1) != None');
assert(math::u256_inv_mod(7, 1).is_none(), 'inv_mov(7, 1) != None');
assert(math::u256_inv_mod(0, 1).is_none(), 'inv_mov(0, 1) != None');
assert(math::u256_inv_mod(0, 7).is_none(), 'inv_mov(0, 7) != None');
assert(math::u256_inv_mod(5, 24).unwrap().into() == 5_u256, 'inv_mod(5, 24) != 5');
assert(math::u256_inv_mod(29, 24).unwrap().into() == 5_u256, 'inv_mod(29, 24) != 5');
assert(math::u256_inv_mod(1, 24).unwrap().into() == 1_u256, 'inv_mod(1, 24) != 1');
assert(math::u256_inv_mod(1, 5).unwrap().into() == 1_u256, 'inv_mod(1, 5) != 1');
assert(math::u256_inv_mod(8, 24).is_none(), 'inv_mod(8, 24) != None');
assert(math::u256_inv_mod(1, 1).is_none(), 'inv_mod(1, 1) != None');
assert(math::u256_inv_mod(7, 1).is_none(), 'inv_mod(7, 1) != None');
assert(math::u256_inv_mod(0, 1).is_none(), 'inv_mod(0, 1) != None');
assert(math::u256_inv_mod(0, 7).is_none(), 'inv_mod(0, 7) != None');
assert(math::u256_inv_mod(3, 6).is_none(), 'inv_mod(3, 6) != None');
assert(math::u256_inv_mod(4, 6).is_none(), 'inv_mod(4, 6) != None');
assert(math::u256_inv_mod(8, 4).is_none(), 'inv_mod(8, 4) != None');
Expand Down

0 comments on commit 99f0528

Please sign in to comment.