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)); +}