From 029bbc9ecccef33842486c664208b55aa8ea9979 Mon Sep 17 00:00:00 2001 From: Vasil Nikolov Date: Mon, 24 Apr 2023 00:46:06 +0300 Subject: [PATCH] add unit test for variance --- src/base/mod.rs | 2 ++ src/base/variance_test.rs | 7 +++++++ 2 files changed, 9 insertions(+) create mode 100644 src/base/variance_test.rs diff --git a/src/base/mod.rs b/src/base/mod.rs index 0f09cc33..1eabbfcf 100644 --- a/src/base/mod.rs +++ b/src/base/mod.rs @@ -64,3 +64,5 @@ pub use self::matrix_view::*; pub use self::storage::*; #[cfg(any(feature = "std", feature = "alloc"))] pub use self::vec_storage::*; + +mod variance_test; diff --git a/src/base/variance_test.rs b/src/base/variance_test.rs new file mode 100644 index 00000000..eec5f7e4 --- /dev/null +++ b/src/base/variance_test.rs @@ -0,0 +1,7 @@ +#[cfg(test)] +use crate::DVector; +#[test] +fn test_variance_new() { + let v = DVector::repeat(10_000, 100000000.1234); + assert_eq!(v.variance(), 0.0) +}