--nilseqs is now a deprecated noop (#17211)
* --nilseqs is now a deprecated noop * fix tests; fix: future => sugar
This commit is contained in:
parent
bb0c19f42c
commit
6c5872c169
15 changed files with 37 additions and 53 deletions
|
|
@ -22,7 +22,7 @@ proc resultVar2: string =
|
|||
result.add("returned")
|
||||
|
||||
doAssert implicit() == "I will be returned"
|
||||
doAssert discarded() == nil
|
||||
doAssert discarded().len == 0
|
||||
doAssert explicit() == "I will be returned"
|
||||
doAssert resultVar() == "I will be returned"
|
||||
doAssert resultVar2() == "I will be returned"
|
||||
|
|
@ -140,7 +140,7 @@ let numbers = @[1, 2, 3, 4, 5, 6]
|
|||
let odd = filter(numbers, proc (x: int): bool = x mod 2 != 0)
|
||||
doAssert odd == @[1, 3, 5]
|
||||
|
||||
import sequtils, future
|
||||
import sequtils, sugar
|
||||
let numbers1 = @[1, 2, 3, 4, 5, 6]
|
||||
let odd1 = filter(numbers1, (x: int) -> bool => x mod 2 != 0)
|
||||
assert odd1 == @[1, 3, 5]
|
||||
|
|
@ -149,7 +149,7 @@ proc isValid(x: int, validator: proc (x: int): bool) =
|
|||
if validator(x): echo(x, " is valid")
|
||||
else: echo(x, " is NOT valid")
|
||||
|
||||
import future
|
||||
import sugar
|
||||
proc isValid2(x: int, validator: (x: int) -> bool) =
|
||||
if validator(x): echo(x, " is valid")
|
||||
else: echo(x, " is NOT valid")
|
||||
|
|
@ -193,7 +193,7 @@ doAssertRaises(IndexDefect):
|
|||
|
||||
block:
|
||||
var list = newSeq[string](3)
|
||||
assert list[0] == nil
|
||||
assert list[0].len == 0
|
||||
list[0] = "Foo"
|
||||
list[1] = "Bar"
|
||||
list[2] = "Baz"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue