From 957105520fc99b307c5981524e9f54b784ffe40d Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Sun, 29 Oct 2017 21:27:22 +0100 Subject: [PATCH] make tests green again --- lib/pure/collections/queues.nim | 3 +-- tests/errmsgs/tshow_asgn.nim | 2 +- tests/exprs/texprstmt.nim | 2 +- tests/iter/tconcat.nim | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/pure/collections/queues.nim b/lib/pure/collections/queues.nim index 4014221622..ce792d6dab 100644 --- a/lib/pure/collections/queues.nim +++ b/lib/pure/collections/queues.nim @@ -198,9 +198,8 @@ when isMainModule: assert($q == "[4, 56, 6, 789]") assert q[0] == q.front and q.front == 4 - assert q[^1] == q.back and q.back == 789 q[0] = 42 - q[^1] = 7 + q[q.len - 1] = 7 assert 6 in q and 789 notin q assert q.find(6) >= 0 diff --git a/tests/errmsgs/tshow_asgn.nim b/tests/errmsgs/tshow_asgn.nim index 250f786e21..cdd325b939 100644 --- a/tests/errmsgs/tshow_asgn.nim +++ b/tests/errmsgs/tshow_asgn.nim @@ -7,7 +7,7 @@ discard """ # bug #5430 -proc random*[T](x: Slice[T]): T = +proc random*[T](x: Slice[T, T]): T = ## For a slice `a .. b` returns a value in the range `a .. b-1`. result = int(x.b - x.a) + x.a diff --git a/tests/exprs/texprstmt.nim b/tests/exprs/texprstmt.nim index 0e92702e89..6c9759cf54 100644 --- a/tests/exprs/texprstmt.nim +++ b/tests/exprs/texprstmt.nim @@ -1,6 +1,6 @@ discard """ line: 10 - errormsg: "expression 'result[1 .. -(len(result), 1)]' is of type 'string' and has to be discarded" + errormsg: "expression 'result[1 .. BackwardsIndex(1)]' is of type 'string' and has to be discarded" """ # bug #578 diff --git a/tests/iter/tconcat.nim b/tests/iter/tconcat.nim index 477ac5e268..94a89b57e5 100644 --- a/tests/iter/tconcat.nim +++ b/tests/iter/tconcat.nim @@ -9,7 +9,7 @@ discard """ 23''' """ -proc toIter*[T](s: Slice[T]): iterator: T = +proc toIter*[T](s: Slice[T, T]): iterator: T = iterator it: T {.closure.} = for x in s.a..s.b: yield x