From 5cb4d5f83c239a3066edafad2ff9fbdb8438f33c Mon Sep 17 00:00:00 2001 From: sebcrozet Date: Sun, 1 Sep 2019 18:27:52 +0200 Subject: [PATCH] Add test for empty matrix multiplication. --- tests/core/empty.rs | 9 +++++++++ tests/core/mod.rs | 1 + 2 files changed, 10 insertions(+) create mode 100644 tests/core/empty.rs diff --git a/tests/core/empty.rs b/tests/core/empty.rs new file mode 100644 index 00000000..05262cd7 --- /dev/null +++ b/tests/core/empty.rs @@ -0,0 +1,9 @@ +use na::{DMatrix, DVector}; + +#[test] +fn empty_mul() { + // Issue #644 + let m = DMatrix::::zeros(8, 0); + let v = DVector::::zeros(0); + assert_eq!(m * v, DVector::zeros(8)); +} \ No newline at end of file diff --git a/tests/core/mod.rs b/tests/core/mod.rs index c53493bd..f8c7e477 100644 --- a/tests/core/mod.rs +++ b/tests/core/mod.rs @@ -8,6 +8,7 @@ mod matrix_slice; #[cfg(feature = "mint")] mod mint; mod serde; +mod empty; #[cfg(feature = "arbitrary")]