diff options
Diffstat (limited to 'nimpretty/tests')
-rw-r--r-- | nimpretty/tests/exhaustive.nim | 31 | ||||
-rw-r--r-- | nimpretty/tests/expected/exhaustive.nim | 31 | ||||
-rw-r--r-- | nimpretty/tests/expected/simple.nim | 11 | ||||
-rw-r--r-- | nimpretty/tests/expected/simple2.nim | 19 | ||||
-rw-r--r-- | nimpretty/tests/expected/simple3.nim | 16 | ||||
-rw-r--r-- | nimpretty/tests/simple.nim | 8 | ||||
-rw-r--r-- | nimpretty/tests/simple2.nim | 19 | ||||
-rw-r--r-- | nimpretty/tests/simple3.nim | 14 |
8 files changed, 148 insertions, 1 deletions
diff --git a/nimpretty/tests/exhaustive.nim b/nimpretty/tests/exhaustive.nim index ab58b7da4..9a0f9a49b 100644 --- a/nimpretty/tests/exhaustive.nim +++ b/nimpretty/tests/exhaustive.nim @@ -329,3 +329,34 @@ proc getKeyAndData(cursor: int, op: int): #!nimpretty on const test = r"C:\Users\-\Desktop\test.txt" + +proc abcdef*[T:not (tuple|object|string|cstring|char|ref|ptr|array|seq|distinct)]() = + # bug #9504 + type T2 = a.type + discard + +proc fun() = + #[ + this one here + ]# + discard + +proc fun2() = + ##[ + foobar + ]## + discard + +#[ +foobar +]# + +proc fun3() = + discard + +##[ +foobar +]## + +# bug #9673 +discard `* `(1, 2) diff --git a/nimpretty/tests/expected/exhaustive.nim b/nimpretty/tests/expected/exhaustive.nim index b114e9b8c..8ea7ca4dd 100644 --- a/nimpretty/tests/expected/exhaustive.nim +++ b/nimpretty/tests/expected/exhaustive.nim @@ -338,3 +338,34 @@ proc getKeyAndData(cursor: int; op: int): #!nimpretty on const test = r"C:\Users\-\Desktop\test.txt" + +proc abcdef*[T: not (tuple|object|string|cstring|char|ref|ptr|array|seq|distinct)]() = + # bug #9504 + type T2 = a.type + discard + +proc fun() = + #[ + this one here + ]# + discard + +proc fun2() = + ##[ + foobar + ]## + discard + +#[ +foobar +]# + +proc fun3() = + discard + +##[ +foobar +]## + +# bug #9673 +discard `*`(1, 2) diff --git a/nimpretty/tests/expected/simple.nim b/nimpretty/tests/expected/simple.nim index 75f570bac..5126658ea 100644 --- a/nimpretty/tests/expected/simple.nim +++ b/nimpretty/tests/expected/simple.nim @@ -1,4 +1,13 @@ var x: int = 2 -echo x # bug #9144 +echo x +# bug #9144 + +proc a() = + while true: + discard + # comment 1 + + # comment 2 + discard diff --git a/nimpretty/tests/expected/simple2.nim b/nimpretty/tests/expected/simple2.nim index 8d60c4067..909ac48c3 100644 --- a/nimpretty/tests/expected/simple2.nim +++ b/nimpretty/tests/expected/simple2.nim @@ -1,3 +1,22 @@ +# comment here var x: int = 2 echo x + +proc fun*() = + echo "ok" + ## doc comment + # regular comment + +proc funB() = + echo "ok1" + # echo "ok2" + +fun() + +#[ +bug #9483 +]# + +proc funE() = + echo "ok1" diff --git a/nimpretty/tests/expected/simple3.nim b/nimpretty/tests/expected/simple3.nim new file mode 100644 index 000000000..7f17e0fc6 --- /dev/null +++ b/nimpretty/tests/expected/simple3.nim @@ -0,0 +1,16 @@ + +#[ +foo bar +]# + + + +proc fun() = + echo "ok1" + +proc fun2(a = "fooo" & "bar" & "bar" & "bar" & "bar" & ( + "bar" & "bar" & "bar") & "bar" & "bar" & "bar" & "bar" & "bar" & "bar" & + "bar" & "bar" & "bar"): auto = + discard + +fun2() diff --git a/nimpretty/tests/simple.nim b/nimpretty/tests/simple.nim index 9e3c52f9b..5126658ea 100644 --- a/nimpretty/tests/simple.nim +++ b/nimpretty/tests/simple.nim @@ -3,3 +3,11 @@ var x: int = 2 echo x # bug #9144 + +proc a() = + while true: + discard + # comment 1 + + # comment 2 + discard diff --git a/nimpretty/tests/simple2.nim b/nimpretty/tests/simple2.nim index 8d60c4067..4ef2ddd70 100644 --- a/nimpretty/tests/simple2.nim +++ b/nimpretty/tests/simple2.nim @@ -1,3 +1,22 @@ +# comment here var x: int = 2 echo x + +proc fun*()= + echo "ok" + ## doc comment + # regular comment + +proc funB() = + echo "ok1" + # echo "ok2" + +fun() + +#[ +bug #9483 +]# + +proc funE() = + echo "ok1" diff --git a/nimpretty/tests/simple3.nim b/nimpretty/tests/simple3.nim new file mode 100644 index 000000000..bd60ddf39 --- /dev/null +++ b/nimpretty/tests/simple3.nim @@ -0,0 +1,14 @@ + +#[ +foo bar +]# + + + +proc fun() = + echo "ok1" + +proc fun2(a = "fooo" & "bar" & "bar" & "bar" & "bar" & ("bar" & "bar" & "bar") & "bar" & "bar" & "bar" & "bar" & "bar" & "bar" & "bar" & "bar" & "bar"): auto = + discard + +fun2() |