This commit is contained in:
Timothee Cour
2021-04-19 19:02:52 -07:00
committed by GitHub
parent 3b80f0dc8e
commit ad67bcf379
5 changed files with 9 additions and 16 deletions

View File

@@ -171,7 +171,7 @@ block tableconstr:
# NEW:
doAssert 56 in 50..100
doAssert 56 in ..60
doAssert 56 in 0..60
block ttables2:

View File

@@ -11,10 +11,9 @@ verichtetd
# Test the new slices.
import strutils
var mystr = "Abgrund"
mystr[..1] = "Zu"
# mystr[..1] = "Zu" # deprecated
mystr[0..1] = "Zu"
mystr[4..4] = "5"
@@ -23,7 +22,8 @@ type
var myarr: array[TEnum, int] = [1, 2, 3, 4, 5, 6]
myarr[e1..e3] = myarr[e4..e6]
myarr[..e3] = myarr[e4..e6]
# myarr[..e3] = myarr[e4..e6] # deprecated
myarr[0..e3] = myarr[e4..e6]
for x in items(myarr): stdout.write(x)
echo()
@@ -46,7 +46,8 @@ echo mystr
mystr[4..4] = "u"
# test full replacement
mystr[.. ^2] = "egerichtet"
# mystr[.. ^2] = "egerichtet" # deprecated
mystr[0 .. ^2] = "egerichtet"
echo mystr