Skip to content

Commit

Permalink
test_reflect_prop: Add a property tying reflect() and angle()
Browse files Browse the repository at this point in the history
  • Loading branch information
nbraud committed Oct 13, 2018
1 parent 7ee5e2b commit 78b0f78
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/test_vector2_reflect.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import pytest
from hypothesis import given, assume, note
from math import isclose, isinf
from utils import units, vectors
from utils import angle_isclose, units, vectors


reflect_data = (
Expand All @@ -28,3 +28,6 @@ def test_reflect_prop(initial: Vector2, normal: Vector2):
assert not any(map(isinf, reflected))
assert initial.isclose(returned)
assert isclose((initial * normal), -(reflected * normal))
assert angle_isclose(normal.angle(initial),
180 - normal.angle(reflected)
)

0 comments on commit 78b0f78

Please sign in to comment.