Skip to content

Commit

Permalink
test u384 zero
Browse files Browse the repository at this point in the history
  • Loading branch information
enitrat committed Sep 4, 2024
1 parent 64f33e1 commit 5c1962b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions corelib/src/test/circuit_test.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use crate::circuit::{
AddInputResultTrait, CircuitInputs,
};

use crate::num::traits::Zero;
use crate::traits::TryInto;

#[test]
Expand Down Expand Up @@ -133,3 +134,10 @@ fn test_fill_inputs_loop() {
let modulus = TryInto::<_, CircuitModulus>::try_into([55, 0, 0, 0]).unwrap();
circuit_inputs.done().eval(modulus).unwrap();
}

#[test]
fn test_u384_zero() {
assert_eq!(Zero::zero(), u384 { limb0: 0, limb1: 0, limb2: 0, limb3: 0 });
assert!(Zero::is_zero(@u384 { limb0: 0, limb1: 0, limb2: 0, limb3: 0 }));
assert!(Zero::is_non_zero(@u384 { limb0: 0, limb1: 1, limb2: 0, limb3: 0 }));
}

0 comments on commit 5c1962b

Please sign in to comment.