Skip to content

Commit

Permalink
Add test for 'Point.op_GreaterThanOrEqual' method
Browse files Browse the repository at this point in the history
  • Loading branch information
lycantropos committed Jul 9, 2023
1 parent 3c1fcce commit 7618479
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tests/point_tests/test_op_GreaterThanOrEqual.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
from hypothesis import given

from tests.binding import Point
from tests.utils import (equivalence,
implication)
from . import strategies


@given(strategies.points)
def test_reflexivity(point: Point) -> None:
assert point >= point


@given(strategies.points, strategies.points)
def test_antisymmetry(first: Point, second: Point) -> None:
assert equivalence(first >= second >= first, first == second)


@given(strategies.points, strategies.points, strategies.points)
def test_transitivity(first: Point, second: Point, third: Point) -> None:
assert implication(first >= second >= third, first >= third)


@given(strategies.points, strategies.points)
def test_alternatives(first: Point, second: Point) -> None:
assert equivalence(first >= second, first > second or first == second)
assert equivalence(first >= second, first > second or not first != second)
assert equivalence(first >= second, second < first or not first != second)
assert equivalence(first >= second, second < first or first == second)
assert equivalence(first >= second, second <= first)
assert equivalence(first >= second, not second > first)
assert equivalence(first >= second, not first < second)

0 comments on commit 7618479

Please sign in to comment.