Skip to content

Commit

Permalink
tests: Assert in test_reflect_prop that no coordinate is infinite
Browse files Browse the repository at this point in the history
  • Loading branch information
nbraud committed Oct 13, 2018
1 parent 3f1ca2b commit f5cc638
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/test_vector2_reflect.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from ppb_vector import Vector2
import pytest
from hypothesis import given, assume, note
from math import isclose
from math import isclose, isinf
from utils import units, vectors


Expand All @@ -25,5 +25,6 @@ def test_reflect_prop(initial: Vector2, normal: Vector2):
reflected = initial.reflect(normal)
returned = reflected.reflect(normal)
note(f"Reflected: {reflected}")
assert not any(map(isinf, reflected))
assert initial.isclose(returned)
assert isclose((initial * normal), -(reflected * normal))

0 comments on commit f5cc638

Please sign in to comment.