fixed system.delete (#18507)

This commit is contained in:
Andreas Rumpf 2021-07-18 15:16:26 +02:00 • committed by GitHub
commit 99c4b69097
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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)