Fix out of bounds access in levenshtein_editops

This commit is contained in:
maxbachmann 2021-08-31 23:04:01 +02:00
parent c41abbfe1c
commit 0362eddd18
2 changed files with 3 additions and 1 deletions

@ -1 +1 @@
Subproject commit 47df6f75a1e8c01554440017259a64f75a93a375
Subproject commit f26ee0e935d28fe86b4fdadb357a0e642b281299

View File

@ -55,6 +55,8 @@ def test_levenshtein_editops():
"""
basic test for levenshtein_editops
"""
assert string_metric.levenshtein_editops("0", "") == [("delete", 1, 0)]
assert string_metric.levenshtein_editops("", "0") == [("insert", 0, 1)]
assert string_metric.levenshtein_editops("qabxcd", "abycdf") == [
("delete", 1, 0), ("replace", 4, 3), ("insert", 6, 6)
]