summary refs log tree commit diff stats
path: root/nimpretty
diff options
context:
space:
mode:
authorMiran <narimiran@disroot.org>2020-07-01 11:40:13 +0200
committerGitHub <noreply@github.com>2020-07-01 11:40:13 +0200
commit1edb9a6178d868e34e76faf9e2a05afbc1431cb0 (patch)
treee82a873f6f1ea19ff5f58f3a0a7259fa2563a44a /nimpretty
parent2867a33ebcaddccdb52b101d0ea5f75f1d4bd66f (diff)
downloadNim-1edb9a6178d868e34e76faf9e2a05afbc1431cb0.tar.gz
fix #14401, trailing comma confuses nimpretty (#14867)
Diffstat (limited to 'nimpretty')
-rw-r--r--nimpretty/tests/exhaustive.nim21
-rw-r--r--nimpretty/tests/expected/exhaustive.nim23
2 files changed, 43 insertions, 1 deletions
diff --git a/nimpretty/tests/exhaustive.nim b/nimpretty/tests/exhaustive.nim
index d61820f7a..2ba885d9a 100644
--- a/nimpretty/tests/exhaustive.nim
+++ b/nimpretty/tests/exhaustive.nim
@@ -822,3 +822,24 @@ proc f =
   # doesn't break the code, but leaving indentation as is would be nice.
   let x = if true: callingProcWhatever()
           else: callingADifferentProc()
+
+
+type
+  EventKind = enum
+    Stop, StopSuccess, StopError,
+    SymbolChange, TextChange,
+
+  SpinnyEvent = tuple
+    kind: EventKind
+    payload: string
+
+
+type
+  EventKind2 = enum
+    Stop2, StopSuccess2, StopError2,
+    SymbolChange2, TextChange2,
+
+type
+  SpinnyEvent2 = tuple
+    kind: EventKind
+    payload: string
diff --git a/nimpretty/tests/expected/exhaustive.nim b/nimpretty/tests/expected/exhaustive.nim
index e120cf019..cfe9a43fa 100644
--- a/nimpretty/tests/expected/exhaustive.nim
+++ b/nimpretty/tests/expected/exhaustive.nim
@@ -812,7 +812,7 @@ let foo = if cond:
 
 let a =
   [[aaadsfas, bbb],
-    [ccc, ddd]]
+   [ccc, ddd]]
 
 let b = [
   [aaa, bbb],
@@ -835,3 +835,24 @@ proc f =
   # doesn't break the code, but leaving indentation as is would be nice.
   let x = if true: callingProcWhatever()
           else: callingADifferentProc()
+
+
+type
+  EventKind = enum
+    Stop, StopSuccess, StopError,
+    SymbolChange, TextChange,
+
+  SpinnyEvent = tuple
+    kind: EventKind
+    payload: string
+
+
+type
+  EventKind2 = enum
+    Stop2, StopSuccess2, StopError2,
+    SymbolChange2, TextChange2,
+
+type
+  SpinnyEvent2 = tuple
+    kind: EventKind
+    payload: string