From 76d4c2bb3a095f065da9c5f461e3f3970c524dd8 Mon Sep 17 00:00:00 2001 From: FrancoisCarouge Date: Sat, 10 Jun 2023 20:54:08 -0700 Subject: [PATCH] [test] add operator bracket test --- test/CMakeLists.txt | 2 +- ...tor_bracket_1x2.cpp => linalg_operator_bracket.cpp} | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) rename test/{linalg_operator_bracket_1x2.cpp => linalg_operator_bracket.cpp} (89%) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 97b445f90..45b0df76d 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -78,7 +78,7 @@ foreach(BACKEND IN ITEMS eigen) "linalg_copy.cpp" "linalg_identity_default.cpp" "linalg_identity.cpp" - "linalg_operator_bracket_1x2.cpp" + "linalg_operator_bracket.cpp" "linalg_operator_equality.cpp" "linalg_zero_default.cpp" "linalg_zero.cpp") diff --git a/test/linalg_operator_bracket_1x2.cpp b/test/linalg_operator_bracket.cpp similarity index 89% rename from test/linalg_operator_bracket_1x2.cpp rename to test/linalg_operator_bracket.cpp index e583017cd..ba91b29b8 100644 --- a/test/linalg_operator_bracket_1x2.cpp +++ b/test/linalg_operator_bracket.cpp @@ -42,9 +42,15 @@ For more information, please refer to */ namespace fcarouge::test { namespace { -//! @test Verifies ... +//! @test Verifies the 1x1 matrix bracket operator. +//! +//! @todo Rewrite this test as a property-based test. [[maybe_unused]] auto test{[] { - // matrix m; + matrix<> m{42.0}; + + assert(m(0) == 42.0); + assert(m(0, 0) == 42.0); + assert(m[0] == 42.0); return 0; }()};