From 8aa7da6be79d6d1979f4a54f7c824babadce676e Mon Sep 17 00:00:00 2001 From: Quaternions Date: Wed, 28 Aug 2024 12:17:00 -0700 Subject: [PATCH] add tests --- fixed_wide/src/lib.rs | 3 +++ fixed_wide/src/tests.rs | 14 ++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 fixed_wide/src/tests.rs diff --git a/fixed_wide/src/lib.rs b/fixed_wide/src/lib.rs index 4d35f29..b593a63 100644 --- a/fixed_wide/src/lib.rs +++ b/fixed_wide/src/lib.rs @@ -9,3 +9,6 @@ pub mod typenum{ mod fixed_wide_traits; #[cfg(feature="fixed_wide_traits")] pub use ::fixed_wide_traits::wide; + +#[cfg(test)] +mod tests; diff --git a/fixed_wide/src/tests.rs b/fixed_wide/src/tests.rs new file mode 100644 index 0000000..0029267 --- /dev/null +++ b/fixed_wide/src/tests.rs @@ -0,0 +1,14 @@ +use fixed_wide_traits::wide::WideMul; + +#[test] +fn test_wide_mul(){ + let a=crate::types::I32F32::ONE; + let aa=a.wide_mul(a); + assert_eq!(aa,crate::types::I64F64::ONE); +} + +#[test] +fn test_bint(){ + let a=crate::types::I32F32::ONE; + assert_eq!(a*2,crate::types::I32F32::from(2)); +}