Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheecour committed Apr 21, 2020
1 parent 5869d17 commit ed35c95
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 15 deletions.
7 changes: 5 additions & 2 deletions tests/concepts/tconcepts_issues.nim
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ type
v: T
converter toObj1[T](t: T): Obj1[T] =
return Obj1[T](v: t)

proc echo2(a: varargs[string, mytostr]) = echo a[0]

block t976:
type
int1 = distinct int
Expand Down Expand Up @@ -117,12 +120,12 @@ block t976:
PrintAble = concept x
$x is string

proc `$`[T](nt: Obj1[T]): string =
proc mytostr[T](nt: Obj1[T]): string =
when T is PrintAble: result = "Printable"
else: result = "Non Printable"

echo Obj2()

echo2 Obj2()


block t1128:
Expand Down
6 changes: 2 additions & 4 deletions tests/destructor/tdestructor3.nim
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ destroy
123
destroy Foo: 123
destroy Foo: 5
(x1: (val: ...))
destroy
---------------
app begin
(val: ...)
destroy
app end
'''
Expand Down Expand Up @@ -96,7 +94,7 @@ proc newObj2(x:int, y: float): MyObject2 =

proc test =
let obj2 = newObj2(1, 1.0)
echo obj2
doAssert obj2.x1.val != nil

test()

Expand All @@ -119,7 +117,7 @@ proc createTop(): ptr TopObject =

proc test2() =
let x = createTop()
echo $x.internal
doAssert x.internal.val != nil
deleteTop(x)

echo "---------------"
Expand Down
2 changes: 1 addition & 1 deletion tests/generics/tgeneric0.nim
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ discard """
0
float32
float32
(name: "Resource 1", readers: ..., writers: ...)
(name: "Resource 1", readers: @[], writers: @[])
'''
"""

Expand Down
2 changes: 1 addition & 1 deletion tests/js/trefbyvar.nim
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ proc initTypeA1(a: int; b: string; c: pointer = nil): TypeA1 =
result.c_impl = c

let x = initTypeA1(1, "a")
doAssert($x == "(a_impl: 1, b_impl: \"a\", c_impl: ...)")
doAssert($x == "(a_impl: 1, b_impl: \"a\", c_impl: nil)")
6 changes: 1 addition & 5 deletions tests/statictypes/tstackmatrix.nim
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
discard """
output: "(M: 3, N: 3, fp: ...)"
"""

# bug #6843

type
Expand All @@ -26,4 +22,4 @@ var
[7'f64, 8, 9]
]
m = stackMatrix(data)
echo m
doAssert m.M == 3 and m.N == 3 and m.fp != nil
4 changes: 2 additions & 2 deletions tests/types/tissues_types.nim
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ true
ptr Foo
(member: "hello world")
(member: 123.456)
(member: "hello world", x: ...)
(member: 123.456, x: ...)
(member: "hello world", x: nil)
(member: 123.456, x: nil)
0
false
'''
Expand Down

0 comments on commit ed35c95

Please sign in to comment.