Skip to content

Commit

Permalink
fix for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
krux02 committed May 7, 2019
1 parent 5594b76 commit 613efcb
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/array/tarray.nim
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,19 @@ block troof:
var d: array['a'..'c', string] = ["a", "b", "c"]
doAssert d[^1] == "c"

# test for default implementation of backwards index

type
MyType = object

proc len(arg: MyType): int = 100
proc `[]`(arg: MyType; idx: int): int = idx

var mt: MyType

assert mt[0] == 0
assert mt[^0] == 100
assert mt[^1] == 99


import strutils, sequtils, typetraits, os
Expand Down

0 comments on commit 613efcb

Please sign in to comment.