Skip to content

Commit 4ed82c4

Browse files
cong: modify tests for upstream change
Specifically the changes in: libsemigroups/libsemigroups#913 which change the number of runners in some Congruence objects, leading to tests failing where the number or existence of certain runners is assumed/required.
1 parent 12ee316 commit 4ed82c4

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

src/cong.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,7 @@ individual algorithms, such as :any:`Kambites`,
6767
>>> cong = Congruence(congruence_kind.twosided, p)
6868
>>> is_obviously_infinite(cong)
6969
True
70-
>>> cong.add_generating_pair([1, 1, 1], [])
71-
<2-sided Congruence over <monoid presentation with 2 letters, 1 rule, and length 2> with 1 gen. pair, 4 runners>
72-
>>> cong.number_of_classes()
70+
>>> cong.add_generating_pair([1, 1, 1], []).number_of_classes()
7371
3
7472
>>> is_obviously_infinite(cong)
7573
False

tests/test_cong.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ def test_has_get():
9393

9494
c = Congruence(congruence_kind.twosided, p)
9595

96-
assert c.number_of_runners() == 4
97-
assert c.has(ToddCoxeter)
98-
tc = c.get(ToddCoxeter)
96+
assert c.number_of_runners() <= 4
97+
assert c.has(Kambites)
98+
k = c.get(Kambites)
9999

100100
c.run()
101101
assert c.number_of_classes() == POSITIVE_INFINITY
@@ -104,12 +104,12 @@ def test_has_get():
104104
assert c.has(KnuthBendix)
105105
assert c.get(KnuthBendix).confluent()
106106

107-
# Check that the ToddCoxeter returned above outlives its deletion in
107+
# Check that the Kambites returned above outlives its deletion in
108108
# Congruence
109-
assert tc.number_of_classes() == POSITIVE_INFINITY
109+
assert k.small_overlap_class() == 1
110110

111111
with pytest.raises(LibsemigroupsError):
112-
c.get(ToddCoxeter)
112+
c.get(Kambites)
113113

114114

115115
def test_normal_forms():

0 commit comments

Comments
 (0)