From 0db46185b148f638a4ee11dbf5d79bdcd93f5b21 Mon Sep 17 00:00:00 2001 From: Sergii Kryvonos Date: Fri, 22 Nov 2024 16:47:44 +0100 Subject: [PATCH] Modulo_Ordering_test --- omnn/math/test/Modulo_test.cpp | 6 ++++++ omnn/math/test/generic.hpp | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/omnn/math/test/Modulo_test.cpp b/omnn/math/test/Modulo_test.cpp index 6619143d1..3a43e84ca 100644 --- a/omnn/math/test/Modulo_test.cpp +++ b/omnn/math/test/Modulo_test.cpp @@ -107,3 +107,9 @@ BOOST_AUTO_TEST_CASE(IsModSimplifiable_test) BOOST_TEST(!result.first); BOOST_TEST(result.second == Valuable()); } + +BOOST_AUTO_TEST_CASE(Modulo_Ordering_test) { + auto _1 = "(1 % ((Y ^ 4)))"_v; + auto _2 = "((-4 * (Y ^ 3)) % ((Y ^ 4)))"_v; + InequalOrderCheck(_1, _2); +} diff --git a/omnn/math/test/generic.hpp b/omnn/math/test/generic.hpp index ac5913fda..14c85b7b0 100644 --- a/omnn/math/test/generic.hpp +++ b/omnn/math/test/generic.hpp @@ -166,5 +166,15 @@ void InequalOrderCheck(const Valuable& _1, const Valuable& _2) Sum{_1, _2}; } +void InequalOrderCheck(const Valuable& _1, const Valuable& _2) +{ + BOOST_TEST(_1 != _2); + auto before = _1.IsComesBefore(_2); + auto after = _2.IsComesBefore(_1); + BOOST_TEST(before != after); + Product{_1, _2}; + Sum{_1, _2}; +} + } // namespace