fixed system.delete (#18507)

This commit is contained in:
Andreas Rumpf
2021-07-18 15:16:26 +02:00
committed by GitHub
parent adba5eb45e
commit 99c4b69097
3 changed files with 26 additions and 12 deletions

View File

@@ -53,8 +53,8 @@ template main =
var s = @["foo", "bar"]
s.delete(1)
doAssert s == @["foo"]
block:
when false:
var s: seq[string]
doAssertRaises(IndexDefect):
s.delete(0)
@@ -66,8 +66,8 @@ template main =
var s = @["foo"]
s.delete(0)
doAssert s == @[]
block: # bug #16544: deleting out of bounds index should raise
when false: # bug #16544: deleting out of bounds index should raise
var s = @["foo"]
doAssertRaises(IndexDefect):
s.delete(1)