diff --git a/server/models/player_test.go b/server/models/player_test.go index accc2a4..2a1bce2 100644 --- a/server/models/player_test.go +++ b/server/models/player_test.go @@ -132,42 +132,6 @@ func TestUpdatePosition(t *testing.T) { }) } } - -func TestHitjunk(t *testing.T) { - testCases := []struct { - description string - playerVelocity Velocity - }{ - {"Moving NW", Velocity{5, -5}}, - {"Moving NE", Velocity{5, 5}}, - {"Moving SW", Velocity{-5, -5}}, - {"Moving SE", Velocity{-5, 5}}, - {"Stationary", Velocity{0, 0}}, - {"Moving N", Velocity{5, 0}}, - {"Moving E", Velocity{0, 5}}, - {"Moving S", Velocity{-5, 0}}, - {"Moving W", Velocity{0, -5}}, - } - for _, tc := range testCases { - t.Run(tc.description, func(t *testing.T) { - p := new(Player) - p.Velocity = tc.playerVelocity - p.hitJunk() - if p.Velocity.Dx != tc.playerVelocity.Dx*JunkBounceFactor { - t.Error("Error calculating player Dx hitting junk") - } - if p.Velocity.Dy != tc.playerVelocity.Dy*JunkBounceFactor { - t.Error("Error calculating player Dy hitting junk") - } - if p.Velocity.Dx < tc.playerVelocity.Dx*JunkBounceFactor { - t.Error("Error x axis bounce factor greater than 1") - } - if p.Velocity.Dy < tc.playerVelocity.Dy*JunkBounceFactor { - t.Error("Error y axis bounce factor greater than 1") - } - }) - } -} func TestHitjunk(t *testing.T) { testCases := []struct { description string