Skip to content

Commit c08a49d

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 dbf6fba commit c08a49d

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

src/cong.cpp

Lines changed: 2 additions & 4 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
@@ -250,7 +248,7 @@ obviously infinite; ``False`` is returned if it is not.
250248
congruence has infinitely many classes.
251249
)pbdoc");
252250
} // bind_cong
253-
} // namespace
251+
} // namespace
254252

255253
void init_cong(py::module& m) {
256254
bind_cong<word_type>(m, "CongruenceWord");

tests/test_cong.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,10 @@ 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 not c.has(ToddCoxeter)
98+
assert c.has(Kambites)
99+
k = c.get(Kambites)
99100

100101
c.run()
101102
assert c.number_of_classes() == POSITIVE_INFINITY
@@ -104,9 +105,9 @@ def test_has_get():
104105
assert c.has(KnuthBendix)
105106
assert c.get(KnuthBendix).confluent()
106107

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

111112
with pytest.raises(LibsemigroupsError):
112113
c.get(ToddCoxeter)

0 commit comments

Comments
 (0)