From 1e0a98d4388934746201a6ff7702e91f82058466 Mon Sep 17 00:00:00 2001 From: fintarin Date: Sun, 30 Jul 2023 11:06:47 +0300 Subject: [PATCH] Add ComplexInfTests --- .../literals/constants/ComplexInfTests.cpp | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 tests/src/literals/constants/ComplexInfTests.cpp diff --git a/tests/src/literals/constants/ComplexInfTests.cpp b/tests/src/literals/constants/ComplexInfTests.cpp new file mode 100644 index 000000000..b20055e3b --- /dev/null +++ b/tests/src/literals/constants/ComplexInfTests.cpp @@ -0,0 +1,31 @@ +#include + +#include "fintamath/literals/constants/ComplexInf.hpp" +#include "fintamath/literals/constants/Pi.hpp" + +using namespace fintamath; + +const ComplexInf c; + +TEST(ComplexInfTests, toStringTest) { + EXPECT_EQ(c.toString(), "ComplexInf"); +} + +TEST(ComplexInfTests, callTest) { + EXPECT_EQ(c()->toString(), "ComplexInf"); +} + +TEST(ComplexInfTests, equalsTest) { + EXPECT_EQ(c, c); + EXPECT_EQ(c, ComplexInf()); + EXPECT_EQ(ComplexInf(), c); + EXPECT_EQ(c, cast(ComplexInf())); + EXPECT_EQ(cast(ComplexInf()), c); + EXPECT_NE(c, Pi()); + EXPECT_NE(Pi(), c); +} + +TEST(ComplexInfTests, getTypeIdTest) { + EXPECT_EQ(ComplexInf::getTypeIdStatic(), MathObjectTypeId(MathObjectType::ComplexInf)); + EXPECT_EQ(ComplexInf().getTypeId(), MathObjectTypeId(MathObjectType::ComplexInf)); +}