Skip to content

Commit

Permalink
Add ComplexInfTests
Browse files Browse the repository at this point in the history
  • Loading branch information
fintarin committed Jul 30, 2023
1 parent 6e761be commit 1e0a98d
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions tests/src/literals/constants/ComplexInfTests.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#include <gtest/gtest.h>

#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<IMathObject>(ComplexInf()));
EXPECT_EQ(cast<IMathObject>(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));
}

0 comments on commit 1e0a98d

Please sign in to comment.