Skip to content

Commit db3db25

Browse files
word-graph: fix follow_path return type
1 parent 33230f8 commit db3db25

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

src/word-graph.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@ The word graphs *x* and *y* are equal at a node *s* if:
760760
m.def(
761761
"word_graph_follow_path",
762762
[](WordGraph_ const& wg, node_type from, word_type const& path) {
763-
return word_graph::follow_path(wg, from, path);
763+
return from_int(word_graph::follow_path(wg, from, path));
764764
},
765765
py::arg("wg"),
766766
py::arg("from"),

tests/test_word_graph.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ def test_follow_path(word_graphs):
137137
with pytest.raises(LibsemigroupsError):
138138
word_graph.follow_path(wg1, 6, [0])
139139

140+
wg1.init(1, 2)
141+
assert word_graph.follow_path(wg1, 0, [0] * 6) == UNDEFINED
142+
140143

141144
def test_is_acyclic(word_graphs):
142145
wg1, wg2 = word_graphs

0 commit comments

Comments
 (0)