aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorJAROWMR <jarorutjes07@gmail.com>2025-01-08 18:40:11 +0100
committerJAROWMR <jarorutjes07@gmail.com>2025-01-08 18:40:11 +0100
commitef3f5b0845ba127c0bfcda8c2fce37013fef3878 (patch)
treee5690ff875a662ee7603844e858d82428d973a78 /src/test
parent424da5eb1500d90389d939cd0b3e6e75d729578d (diff)
parent2ad15f3efab481659543a1c03cd70a36fd297538 (diff)
Merge branch 'master' of github.com:lonkaars/crepe into jaro/game
Diffstat (limited to 'src/test')
-rw-r--r--src/test/Vector2Test.cpp10
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);
+}