summary refs log tree commit diff stats
path: root/nimpretty
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2019-06-08 00:00:00 +0200
committerAndreas Rumpf <rumpf_a@web.de>2019-06-08 00:00:00 +0200
commit9f82e07b2dc2ea89e1e35d5ec470fae84eab66b4 (patch)
tree0a9654fa2dbb34d9a58bd725d7d5d805279eed86 /nimpretty
parent2c03c9f42e882eaff4f8e8fa358b9c66ecdd803a (diff)
downloadNim-9f82e07b2dc2ea89e1e35d5ec470fae84eab66b4.tar.gz
nimpretty: fixes #10156 [bugfix]
Diffstat (limited to 'nimpretty')
-rw-r--r--nimpretty/tests/expected/wrong_ind.nim49
-rw-r--r--nimpretty/tests/wrong_ind.nim49
2 files changed, 98 insertions, 0 deletions
diff --git a/nimpretty/tests/expected/wrong_ind.nim b/nimpretty/tests/expected/wrong_ind.nim
index a21e94618..9855e0c4d 100644
--- a/nimpretty/tests/expected/wrong_ind.nim
+++ b/nimpretty/tests/expected/wrong_ind.nim
@@ -22,3 +22,52 @@ proc funB() =
       3
     ]
     discard
+
+
+# bug #10156
+proc foo =
+    ## Comment 1
+    ## Comment 2
+    discard
+
+proc bar =
+    ## Comment 3
+    ## Comment 4
+    ## More here.
+    discard
+
+
+proc barB =
+    # Comment 5
+    # Comment 6
+    discard
+
+
+var x: int = 2
+
+echo x
+# bug #9144
+
+proc a() =
+    if cond:
+        while true:
+            discard
+            # comment 1
+        # end while
+    #end if
+
+    # comment 2
+        #if
+            #case
+            #end case
+        #end if
+    discard
+
+
+proc a() =
+    while true:
+        discard
+        # comment 1
+
+    # comment 2
+    discard
diff --git a/nimpretty/tests/wrong_ind.nim b/nimpretty/tests/wrong_ind.nim
index 0559673f8..eaa561b51 100644
--- a/nimpretty/tests/wrong_ind.nim
+++ b/nimpretty/tests/wrong_ind.nim
@@ -22,3 +22,52 @@ proc funB() =
     3
   ]
   discard
+
+
+# bug #10156
+proc foo =
+    ## Comment 1
+    ## Comment 2
+    discard
+
+proc bar =
+  ## Comment 3
+  ## Comment 4
+  ## More here.
+  discard
+
+
+proc barB =
+  # Comment 5
+  # Comment 6
+  discard
+
+
+var x: int = 2
+
+echo x
+# bug #9144
+
+proc a() =
+  if cond:
+    while true:
+      discard
+      # comment 1
+    # end while
+  #end if
+
+  # comment 2
+    #if
+      #case
+      #end case
+    #end if
+  discard
+
+
+proc a() =
+  while true:
+    discard
+    # comment 1
+
+  # comment 2
+  discard