Skip to content

Commit

Permalink
Add gap init test.
Browse files Browse the repository at this point in the history
  • Loading branch information
salt-die committed Nov 27, 2023
1 parent ed2fb2a commit d575677
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/test_gap_init.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import pytest
from mind_the_gaps import Endpoint, Gaps


def test_unsorted_closed():
with pytest.raises(ValueError, match=r"unsorted"):
Gaps([1, 0])


def test_unsorted_open():
with pytest.raises(ValueError, match=r"unsorted"):
Gaps([Endpoint(1, "("), Endpoint(0, ")")])


def test_singleton_ok():
Gaps([1, 1])


def test_missing_singleton_ok():
Gaps([0, Endpoint(1, ")"), Endpoint(1, "("), 2])


def test_open_closed():
with pytest.raises(ValueError, match=r"not minimally expressed"):
Gaps([0, Endpoint(1, ")"), 1, 2])

0 comments on commit d575677

Please sign in to comment.