mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-17 21:12:42 +00:00
fix cmpIgnoreStyle bug (#16392)
This commit is contained in:
@@ -372,6 +372,7 @@ proc cmpIgnoreStyle(a, b: cstring): int {.noSideEffect.} =
|
||||
else: result = c
|
||||
var i = 0
|
||||
var j = 0
|
||||
if a[0] != b[0]: return 1
|
||||
while true:
|
||||
while a[i] == '_': inc(i)
|
||||
while b[j] == '_': inc(j) # BUGFIX: typo
|
||||
|
||||
@@ -58,3 +58,14 @@ block:
|
||||
for i in 0 .. m.len-1:
|
||||
for j in 0 .. m[i].len-1:
|
||||
doAssert getString(m[i][j]) == myArr[i][j]
|
||||
|
||||
block:
|
||||
type
|
||||
Test = enum
|
||||
Hello, he_llo
|
||||
|
||||
var x = hello
|
||||
var y = x.toAny
|
||||
|
||||
doAssert getEnumOrdinal(y, "Hello") == 0
|
||||
doAssert getEnumOrdinal(y, "hello") == 1
|
||||
|
||||
Reference in New Issue
Block a user