fixes #17768 [backport:1.4] (#18317)

* fixes #17768 [backport:1.4]

* tiny
This commit is contained in:
flywind 2021-06-21 18:50:47 +08:00 • committed by GitHub
commit 2deb7011f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 7 deletions

View file

@ -1,4 +1,4 @@
import unicode
import std/unicode
proc asRune(s: static[string]): Rune =
@ -213,3 +213,10 @@ block differentSizes:
doAssert swapCase("ⱥbCd") == "ȺBcD"
doAssert swapCase("XyꟆaB") == "xYᶎAb"
doAssert swapCase("aᵹcᲈd") == "AꝽCꙊD"
block: # bug #17768
let s1 = "abcdef"
let s2 = "abcdéf"
doAssert s1.runeSubstr(0, -1) == "abcde"
doAssert s2.runeSubstr(0, -1) == "abcdé"