diff --git a/src/test/scala/cosc250/boids/Vec2Spec.scala b/src/test/scala/cosc250/boids/Vec2Spec.scala deleted file mode 100644 index 65599e751467826af5a059942fcb60b6aecef40f..0000000000000000000000000000000000000000 --- a/src/test/scala/cosc250/boids/Vec2Spec.scala +++ /dev/null @@ -1,40 +0,0 @@ -package cosc250.boids - -import org.scalatest._ - - -/** - * - */ -class Vec2Spec extends FlatSpec with Matchers { - - "Vec2" should "be able to add vectors" in { - Vec2(1, 2) + Vec2(3, 4) should be (Vec2(4, 6)) - } - - it should "be able to subtract vectors" in { - Vec2(8, 9) - Vec2(3, 4) should be (Vec2(5, 5)) - } - - it should "be able to multiply a vector by a number" in { - Vec2(8, 9) * 4 should be (Vec2(32, 36)) - } - - it should "be able to divide a vector by a number" in { - Vec2(8, 6) / 2 should be (Vec2(4, 3)) - } - - it should "limit the size of a vector" in { - Vec2(10, 0).limit(5) should be (Vec2(5, 0)) - } - - it should "calculcate vectors from a direction and an angle in radians" in { - val Vec2(x, y) = Vec2.fromRTheta(4, Math.PI) - - // There could be a rounding error -- these are doubles, so floor them as - // we know where Math.PI should go - Vec2(x.floor, y.floor) should be (Vec2(-4, 0)) - } - - -} diff --git a/src/test/scala/cosc250/boids/Vec2Suite.scala b/src/test/scala/cosc250/boids/Vec2Suite.scala new file mode 100644 index 0000000000000000000000000000000000000000..ef6d952729ea77f7fffd31caefa1769d5eb2f14b --- /dev/null +++ b/src/test/scala/cosc250/boids/Vec2Suite.scala @@ -0,0 +1,37 @@ +package cosc250.boids + +/** + * + */ +class Vec2Suite extends munit.FunSuite { + + test("Vec2 should be able to add vectors") { + assertEquals(Vec2(1, 2) + Vec2(3, 4), Vec2(4, 6)) + } + + test("it should be able to subtract vectors") { + assertEquals(Vec2(8, 9) - Vec2(3, 4), Vec2(5, 5)) + } + + test("it should be able to multiply a vector by a number") { + assertEquals(Vec2(8, 9) * 4, Vec2(32, 36)) + } + + test("it should be able to divide a vector by a number") { + assertEquals(Vec2(8, 6) / 2, Vec2(4, 3)) + } + + test("it should limit the size of a vector") { + assertEquals(Vec2(10, 0).limit(5), Vec2(5, 0)) + } + + test("it should calculcate vectors from a direction and an angle in radians") { + val Vec2(x, y) = Vec2.fromRTheta(4, Math.PI) + + // There could be a rounding error -- these are doubles, so floor them as + // we know where Math.PI should go + assertEquals(Vec2(x.floor, y.floor), Vec2(-4, 0)) + } + + +}