Closed NotBad4U closed 6 years ago
Your test behaviors can be changed removing FlatSpec and adding WordSpec inheritance like this:
class BehaviorsSpec() extends WordSpec with Matchers {
val MAX_VELOCITY: Short = 3: Short
"An entity" should {
"move toward the target with steer behavior" in {
...
}
"run away from the target with flee behavior" in {
...
}
"be able to pursuit a target" in {
...
}
"be evade from a pursuer" in {
...
}
}
}```
Work to complete #1 #2 #3
This PR:
target:(Vector2d, Vector2d)
=>case class Target(position: Vector2d, velocity: Vector2d)
normalize()
in Vector2dPlease help if you know how to compare 2 double with just a precision at 10^-2. I need to dos this:
should be (new Vector2d(-4.567868516922847, -3.5511451511049703))
but I'll prefer something likeshould be (new Vector2d(-4.56, -3.55))
For now, my test look like this:
But that give me this output in the test repport:
Where I prefer something like (only one "An entity"):
I tried to make my code like that:
but I got this error:
What I understand is the combo with
extend FlatSpec with Matchers with WordSpecLike
is not correct.