From 8620f57f7101b2090add89330e74854b77161d3f Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Mon, 6 Jan 2025 13:18:40 +0100 Subject: place zapper method --- src/test/Vector2Test.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/test/Vector2Test.cpp') diff --git a/src/test/Vector2Test.cpp b/src/test/Vector2Test.cpp index 1e21af9..b17f95a 100644 --- a/src/test/Vector2Test.cpp +++ b/src/test/Vector2Test.cpp @@ -1,6 +1,7 @@ #include #include +#include using namespace crepe; @@ -530,3 +531,12 @@ TEST_F(Vector2Test, Perpendicular) { EXPECT_FLOAT_EQ(result4.x, -4.0f); EXPECT_FLOAT_EQ(result4.y, 3.0f); } + +TEST_F(Vector2Test, Rotate) { + vec2 foo {0, 1}; + + foo = foo.rotate(90); + const float GOOD_ENOUGH = 0.001; + EXPECT_NEAR(foo.x, 1, GOOD_ENOUGH); + EXPECT_NEAR(foo.y, 0, GOOD_ENOUGH); +} -- cgit v1.2.3