mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
Add equality comparator to geometry classes (#1882)
This commit is contained in:
committed by
Peter Johnson
parent
62f07c182c
commit
86b666bba9
@@ -53,3 +53,15 @@ TEST(Rotation2dTest, Minus) {
|
||||
|
||||
EXPECT_NEAR((one - two).Degrees().to<double>(), 40.0, kEpsilon);
|
||||
}
|
||||
|
||||
TEST(Rotation2dTest, Equality) {
|
||||
const auto one = Rotation2d(43_deg);
|
||||
const auto two = Rotation2d(43_deg);
|
||||
EXPECT_TRUE(one == two);
|
||||
}
|
||||
|
||||
TEST(Rotation2dTest, Inequality) {
|
||||
const auto one = Rotation2d(43_deg);
|
||||
const auto two = Rotation2d(43.5_deg);
|
||||
EXPECT_TRUE(one != two);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user