diff options
author | heavydemon21 <nielsstunnebrink1@gmail.com> | 2025-01-08 14:39:16 +0100 |
---|---|---|
committer | heavydemon21 <nielsstunnebrink1@gmail.com> | 2025-01-08 14:39:16 +0100 |
commit | 18a8813645187102fc6261b8d5be1a41c8f0dae4 (patch) | |
tree | 655c5d22027fa23af3378df2d92d4051a71be2a6 /src/test | |
parent | 0729209117a4393e66d7f5b6d83083e2d7c0694c (diff) | |
parent | d9c67da9b8c2d8d25ef4dd2c700ddc78573d3a60 (diff) |
Merge remote-tracking branch 'origin/loek/game' into niels/game
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/Vector2Test.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
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 <gtest/gtest.h> #include <crepe/api/Vector2.h> +#include <crepe/types.h> 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); +} |