From e2a34afda05559791cb20730d67dacb4eef72abd Mon Sep 17 00:00:00 2001 From: Nicole Date: Mon, 25 Nov 2024 12:49:05 -0300 Subject: [PATCH] add test inv of zero error --- math/src/field/fields/fft_friendly/quartic_babybear.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/math/src/field/fields/fft_friendly/quartic_babybear.rs b/math/src/field/fields/fft_friendly/quartic_babybear.rs index 6465542e1..0429130ca 100644 --- a/math/src/field/fields/fft_friendly/quartic_babybear.rs +++ b/math/src/field/fields/fft_friendly/quartic_babybear.rs @@ -328,6 +328,12 @@ mod tests { assert_eq!(a.inv().unwrap(), a); } + #[test] + fn test_inv_of_zero_error() { + let result = Fp4E::zero().inv(); + assert!(result.is_err()); + } + #[test] fn test_mul_by_inv_is_identity() { let a = Fp4E::from(123456);