From 1b17c9f693754b69b249ca604533dccb2a421fab Mon Sep 17 00:00:00 2001 From: Miran Date: Mon, 29 Oct 2018 17:07:27 +0100 Subject: More descriptive names of test files (#9531) * change generic `tissues` name to more specific * change `tvarious` to more specific names --- tests/closure/tclosure_issues.nim | 54 ++++++++++++++++++++++++++++++++++++++ tests/closure/tissues.nim | 55 --------------------------------------- 2 files changed, 54 insertions(+), 55 deletions(-) create mode 100644 tests/closure/tclosure_issues.nim delete mode 100644 tests/closure/tissues.nim (limited to 'tests/closure') diff --git a/tests/closure/tclosure_issues.nim b/tests/closure/tclosure_issues.nim new file mode 100644 index 000000000..b2d77c571 --- /dev/null +++ b/tests/closure/tclosure_issues.nim @@ -0,0 +1,54 @@ +discard """ + output: '''true''' +""" + + +block tissue600: + for i in 1..1: + var reported = false + proc report() = + reported = true + + + +import sequtils +block tissue1502def: + let xs: seq[tuple[key: string, val: seq[string]]] = @[("foo", @["bar"])] + + let maps = xs.map( + proc(x: auto): tuple[typ: string, maps: seq[string]] = + (x.key, x.val.map(proc(x: string): string = x))) + + + +block tissue1642: + var i = 0 + proc p() = inc(i) + + + +block tissue1846: + type + TBinOp[T] = proc (x,y: T): bool + THeap[T] = object + cmp: TBinOp[T] + + proc less[T](x,y: T): bool = + x < y + + proc initHeap[T](cmp: TBinOp[T]): THeap[T] = + result.cmp = cmp + + var h = initHeap[int](less[int]) + echo h.cmp(2,3) + + + +block tissue1911: + proc foo(x: int) : auto = + + proc helper() : int = x + proc bar() : int = helper() + proc baz() : int = helper() + + return (bar, baz) diff --git a/tests/closure/tissues.nim b/tests/closure/tissues.nim deleted file mode 100644 index d33e3b403..000000000 --- a/tests/closure/tissues.nim +++ /dev/null @@ -1,55 +0,0 @@ -discard """ - file: "tissues.nim" - output: '''true''' -""" - - -block tissue600: - for i in 1..1: - var reported = false - proc report() = - reported = true - - - -import sequtils -block tissue1502def: - let xs: seq[tuple[key: string, val: seq[string]]] = @[("foo", @["bar"])] - - let maps = xs.map( - proc(x: auto): tuple[typ: string, maps: seq[string]] = - (x.key, x.val.map(proc(x: string): string = x))) - - - -block tissue1642: - var i = 0 - proc p() = inc(i) - - - -block tissue1846: - type - TBinOp[T] = proc (x,y: T): bool - THeap[T] = object - cmp: TBinOp[T] - - proc less[T](x,y: T): bool = - x < y - - proc initHeap[T](cmp: TBinOp[T]): THeap[T] = - result.cmp = cmp - - var h = initHeap[int](less[int]) - echo h.cmp(2,3) - - - -block tissue1911: - proc foo(x: int) : auto = - - proc helper() : int = x - proc bar() : int = helper() - proc baz() : int = helper() - - return (bar, baz) -- cgit 1.4.1-2-gfad0 ahoang/Nim/plain/tests/tools/tlinter.nim?h=devel&id=89f76bb4484ee49228558baa96001147136c8c2d'>plain) (blame)
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
34
35
36
37
38
39
40