From 7098a4f07ec49044514e149b20e07a68b339622e Mon Sep 17 00:00:00 2001 From: Andreas Longva Date: Sat, 17 Apr 2021 09:45:53 +0200 Subject: [PATCH] Test that matrix![] can be used with const --- nalgebra-macros/tests/tests.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/nalgebra-macros/tests/tests.rs b/nalgebra-macros/tests/tests.rs index 1113a79d..0b594b31 100644 --- a/nalgebra-macros/tests/tests.rs +++ b/nalgebra-macros/tests/tests.rs @@ -32,4 +32,12 @@ fn matrix_small_dims_exhaustive() { Matrix4x3::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)); assert_eq!(matrix![1, 2, 3, 4; 5, 6, 7, 8; 9, 10, 11, 12; 13, 14, 15, 16], Matrix4::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)); +} + +#[test] +fn matrix_const_fn() { + // Ensure that matrix! can be used in const contexts + const _: SMatrix = matrix![]; + const _: SMatrix = matrix![1, 2]; + const _: SMatrix = matrix![1, 2, 3; 4, 5, 6]; } \ No newline at end of file