From 041b8c4b2c6eb1caada5d673adb4a8cd505920e6 Mon Sep 17 00:00:00 2001 From: Andreas Longva Date: Fri, 30 Apr 2021 17:07:21 +0200 Subject: [PATCH] Add macro sanity tests to macros --- tests/core/macros.rs | 11 +++++++++++ tests/core/mod.rs | 3 +++ tests/lib.rs | 2 -- 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 tests/core/macros.rs diff --git a/tests/core/macros.rs b/tests/core/macros.rs new file mode 100644 index 00000000..cdc4de03 --- /dev/null +++ b/tests/core/macros.rs @@ -0,0 +1,11 @@ +use nalgebra::{dmatrix, dvector, matrix, vector}; + +#[test] +fn sanity_test() { + // The macros are already tested in `nalgebra-macros`. Here we just test that they compile fine. + + let _ = matrix![1, 2, 3; 4, 5, 6]; + let _ = dmatrix![1, 2, 3; 4, 5, 6]; + let _ = vector![1, 2, 3, 4, 5, 6]; + let _ = dvector![1, 2, 3, 4, 5, 6]; +} \ No newline at end of file diff --git a/tests/core/mod.rs b/tests/core/mod.rs index 4f9bc745..aa005264 100644 --- a/tests/core/mod.rs +++ b/tests/core/mod.rs @@ -16,3 +16,6 @@ mod matrixcompare; #[cfg(feature = "arbitrary")] pub mod helper; + +#[cfg(feature = "macros")] +mod macros; \ No newline at end of file diff --git a/tests/lib.rs b/tests/lib.rs index b1da01c3..d08f4807 100644 --- a/tests/lib.rs +++ b/tests/lib.rs @@ -25,8 +25,6 @@ mod linalg; #[cfg(feature = "proptest-support")] mod proptest; -mod macros; - //#[cfg(all(feature = "debug", feature = "compare", feature = "rand"))] //#[cfg(feature = "sparse")] //mod sparse;