summary refs log tree commit diff stats
path: root/tests/niminaction/Chapter2/various2.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/niminaction/Chapter2/various2.nim')
-rw-r--r--tests/niminaction/Chapter2/various2.nim10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/niminaction/Chapter2/various2.nim b/tests/niminaction/Chapter2/various2.nim
index dddbdb472..921f38c7d 100644
--- a/tests/niminaction/Chapter2/various2.nim
+++ b/tests/niminaction/Chapter2/various2.nim
@@ -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")
@@ -179,13 +179,13 @@ for i in list4.low .. list4.high:
   echo(list4[i])
 
 var list5: seq[int] = @[]
-doAssertRaises(IndexError):
+doAssertRaises(IndexDefect):
   list5[0] = 1
 
 list5.add(1)
 
 assert list5[0] == 1
-doAssertRaises(IndexError):
+doAssertRaises(IndexDefect):
   echo list5[42]
 
 # -- Errata: var list: seq[int]; echo(list[0]). This now creates an exception,
@@ -193,7 +193,7 @@ doAssertRaises(IndexError):
 
 block:
   var list = newSeq[string](3)
-  assert list[0] == nil
+  assert list[0].len == 0
   list[0] = "Foo"
   list[1] = "Bar"
   list[2] = "Baz"