From 91609bf1121e1e7146fbffd56a7a840453c98fd2 Mon Sep 17 00:00:00 2001 From: James Mitchell Date: Thu, 12 Mar 2026 11:20:57 +0000 Subject: [PATCH] cong: modify tests for upstream change Specifically the changes in: https://github.com/libsemigroups/libsemigroups/pull/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. --- src/cong.cpp | 4 +--- tests/test_cong.py | 12 ++++++------ 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/cong.cpp b/src/cong.cpp index 7a439b69..53599009 100644 --- a/src/cong.cpp +++ b/src/cong.cpp @@ -67,9 +67,7 @@ individual algorithms, such as :any:`Kambites`, >>> cong = Congruence(congruence_kind.twosided, p) >>> is_obviously_infinite(cong) True - >>> cong.add_generating_pair([1, 1, 1], []) - <2-sided Congruence over with 1 gen. pair, 4 runners> - >>> cong.number_of_classes() + >>> cong.add_generating_pair([1, 1, 1], []).number_of_classes() 3 >>> is_obviously_infinite(cong) False diff --git a/tests/test_cong.py b/tests/test_cong.py index cb9b4e1f..61766e71 100644 --- a/tests/test_cong.py +++ b/tests/test_cong.py @@ -93,9 +93,9 @@ def test_has_get(): c = Congruence(congruence_kind.twosided, p) - assert c.number_of_runners() == 4 - assert c.has(ToddCoxeter) - tc = c.get(ToddCoxeter) + assert c.number_of_runners() <= 4 + assert c.has(Kambites) + k = c.get(Kambites) c.run() assert c.number_of_classes() == POSITIVE_INFINITY @@ -104,12 +104,12 @@ def test_has_get(): assert c.has(KnuthBendix) assert c.get(KnuthBendix).confluent() - # Check that the ToddCoxeter returned above outlives its deletion in + # Check that the Kambites returned above outlives its deletion in # Congruence - assert tc.number_of_classes() == POSITIVE_INFINITY + assert k.small_overlap_class() == 1 with pytest.raises(LibsemigroupsError): - c.get(ToddCoxeter) + c.get(Kambites) def test_normal_forms():