Skip to content

Commit f292694

Browse files
Check alphabet
1 parent 37c572e commit f292694

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

tests/test_to.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,6 @@ def check_knuth_bendix_to_pres(WordIn, WordOut, Rewriter):
114114
kb = KnuthBendix(congruence_kind.twosided, p, Rewriter=Rewriter)
115115
q = to(kb, Return=(Presentation, WordOut))
116116

117-
if WordOut is str:
118-
assert isinstance(to_cxx(q), PresentationStrings)
119-
else:
120-
assert isinstance(to_cxx(q), PresentationWords)
121-
122117
assert len(q.rules) == kb.number_of_active_rules() * 2
123118

124119
if WordIn is WordOut:
@@ -129,6 +124,12 @@ def check_knuth_bendix_to_pres(WordIn, WordOut, Rewriter):
129124
presentation.sort_rules(q)
130125
# This is because sample_pres is already confluent
131126
assert p == q
127+
elif WordOut is str:
128+
assert isinstance(to_cxx(q), PresentationStrings)
129+
assert q.alphabet() == "ab"
130+
else:
131+
assert isinstance(to_cxx(q), PresentationWords)
132+
assert q.alphabet() == [0, 1]
132133

133134

134135
def check_froidure_pin_to_pres(Word):

0 commit comments

Comments
 (0)