Skip to content

Commit

Permalink
Merge pull request #2518 from o1-labs/dw/mvpoly-prime-improve-code-co…
Browse files Browse the repository at this point in the history
…verage

MVPoly/prime: code coverage for is_zero and debug
  • Loading branch information
dannywillems authored Sep 4, 2024
2 parents c17b9e1 + 37b3ca2 commit 4131fe0
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions mvpoly/tests/prime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -802,3 +802,20 @@ fn test_mvpoly_mul_pbt() {
let p2 = unsafe { Dense::<Fp, 4, 6>::random(&mut rng, Some(max_degree)) };
assert_eq!(p1.clone() * p2.clone(), p2.clone() * p1.clone());
}

#[test]
fn test_can_be_printed_with_debug() {
let mut rng = o1_utils::tests::make_test_rng(None);
let p1 = unsafe { Dense::<Fp, 2, 2>::random(&mut rng, None) };
println!("{:?}", p1);
}

#[test]
fn test_is_zero() {
let mut rng = o1_utils::tests::make_test_rng(None);
let p1 = Dense::<Fp, 4, 6>::zero();
assert!(p1.is_zero());

let p2 = unsafe { Dense::<Fp, 4, 6>::random(&mut rng, None) };
assert!(!p2.is_zero());
}

0 comments on commit 4131fe0

Please sign in to comment.