mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 08:54:53 +00:00
fixes #23060
This commit is contained in:
@@ -18,7 +18,7 @@ proc editDistance*(a, b: string): int {.noSideEffect.} =
|
||||
## This uses the `Levenshtein`:idx: distance algorithm with only a linear
|
||||
## memory overhead.
|
||||
runnableExamples: static: doAssert editdistance("Kitten", "Bitten") == 1
|
||||
if len(a) > len(b):
|
||||
if runeLen(a) > runeLen(b):
|
||||
# make `b` the longer string
|
||||
return editDistance(b, a)
|
||||
# strip common prefix
|
||||
|
||||
5
tests/errmsgs/t23060.nim
Normal file
5
tests/errmsgs/t23060.nim
Normal file
@@ -0,0 +1,5 @@
|
||||
discard """
|
||||
errormsg: "undeclared identifier: '♔♕♖♗♘♙'"
|
||||
"""
|
||||
|
||||
♔♕♖♗♘♙ = 1
|
||||
Reference in New Issue
Block a user