From 24c88e2b5bc6977fc1eb1c6e87b4af6971d76a5c Mon Sep 17 00:00:00 2001 From: Quaternions Date: Fri, 23 Aug 2024 17:23:03 -0700 Subject: [PATCH] move tests into its own folder --- src/lib.rs | 28 +--------------------------- src/tests/mod.rs | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 27 deletions(-) create mode 100644 src/tests/mod.rs diff --git a/src/lib.rs b/src/lib.rs index 1d4be86..727e5c2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,29 +1,3 @@ -use fixed_wide::wide::WideMul; - -type Planar64=fixed::types::I32F32; -type Planar64Wide1=fixed::types::I64F64; -type Planar64Wide2=fixed_wide::types::I128F128; -type Planar64Wide3=fixed_wide::types::I256F256; #[cfg(test)] -mod tests { - use super::*; - - #[test] - fn it_works() { - let a=Planar64::from(2); - let b=Planar64::from(3); - - let w1=a.wide_mul(b); - let w2=w1.wide_mul(w1); - let w3=w2.wide_mul(w2); - - assert_eq!(w3,Planar64Wide3::from(1296)); - } - - #[test] - pub fn main(){ - let max=i32::MAX as i64; - println!("{} {}",max*max,i64::MAX); - } -} +mod tests; diff --git a/src/tests/mod.rs b/src/tests/mod.rs new file mode 100644 index 0000000..c91a008 --- /dev/null +++ b/src/tests/mod.rs @@ -0,0 +1,24 @@ +use fixed_wide::wide::WideMul; + +type Planar64=fixed::types::I32F32; +//type Planar64Wide1=fixed::types::I64F64; +//type Planar64Wide2=fixed_wide::types::I128F128; +type Planar64Wide3=fixed_wide::types::I256F256; + +#[test] +fn it_works() { + let a=Planar64::from(2); + let b=Planar64::from(3); + + let w1=a.wide_mul(b); + let w2=w1.wide_mul(w1); + let w3=w2.wide_mul(w2); + + assert_eq!(w3,Planar64Wide3::from(1296)); +} + +#[test] +pub fn main(){ + let max=i32::MAX as i64; + println!("{} {}",max*max,i64::MAX); +}