summary refs log tree commit diff stats
path: root/tests/effects/tsidee2.nim
Commit message (Expand)AuthorAgeFilesLines
* require errormsg to be specified before file.Arne Döring2018-12-111-4/+0
* tests: Trim .nim files trailing whitespaceAdam Strzelecki2015-09-041-2/+2
* new tester; all tests categorizedAraq2014-01-131-0/+17
m/commit/tests/ccgbugs/twrongrefcounting.nim?h=devel&id=88b65ea957b286bf7225c63e38b6d83632ee6cce'>88b65ea95 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33



                                                                                            










                                                      

















                             
discard """
  output: '''ok'''
  cmd: "nim c -r --gc:refc -d:useGcAssert -d:useSysAssert -d:fulldebug -d:smokeCycles $file"
"""

# bug #9825
func empty(T: typedesc): T = discard
const emptyChunk = @(empty(array[10, byte]))

var lst: seq[seq[byte]]
lst.add emptyChunk

doAssert($lst == "@[@[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]")


# bug #6234
type
    Foo = ref object
        s: seq[Bar]
    Bar = ref object
        f: Foo

proc test() =
    var f = Foo.new()
    for i in 0 .. 5:
        f.s = @[]
        for j in 0 .. 5:
            var b = Bar.new()
            b.f = f
            f.s.add(b)

test()
echo "ok"