Skip to content

Commit

Permalink
MVPoly: implement more tests for mul_by_const
Browse files Browse the repository at this point in the history
  • Loading branch information
dannywillems committed Aug 27, 2024
1 parent b9cf82a commit 2b1559d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions mvpoly/tests/prime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,3 +247,19 @@ fn test_mul_by_const() {
p2[0] = c;
assert_eq!(p2 * p1.clone(), p1.clone().mul_by_const(c))
}

#[test]
fn test_mul_by_const_with_zero() {
let mut rng = o1_utils::tests::make_test_rng(None);
let p1 = Dense::<Fp, 4, 5>::random(&mut rng);
let c = Fp::zero();
assert_eq!(p1.mul_by_const(c), Dense::<Fp, 4, 5>::zero())
}

#[test]
fn test_mul_by_const_with_one() {
let mut rng = o1_utils::tests::make_test_rng(None);
let p1 = Dense::<Fp, 4, 5>::random(&mut rng);
let c = Fp::one();
assert_eq!(p1.mul_by_const(c), p1)
}

0 comments on commit 2b1559d

Please sign in to comment.