summary refs log tree commit diff stats
path: root/nimpretty
diff options
context:
space:
mode:
authorMiran <narimiran@disroot.org>2019-07-03 18:55:15 +0200
committerGitHub <noreply@github.com>2019-07-03 18:55:15 +0200
commit0718d6c2cddac89256e2fcde17407f1685f1a457 (patch)
tree44bc170e4b22a69ebdba564ad669e78920152e6f /nimpretty
parent045eeab6b4eb95f855ffe73faa5de99a37e1cf74 (diff)
downloadNim-0718d6c2cddac89256e2fcde17407f1685f1a457.tar.gz
[bugfix] fix wrong nimpretty unidents, refs #11616 (#11645)
Diffstat (limited to 'nimpretty')
-rw-r--r--nimpretty/tests/exhaustive.nim12
-rw-r--r--nimpretty/tests/expected/exhaustive.nim13
2 files changed, 25 insertions, 0 deletions
diff --git a/nimpretty/tests/exhaustive.nim b/nimpretty/tests/exhaustive.nim
index 68d71e7a5..c0d4ac084 100644
--- a/nimpretty/tests/exhaustive.nim
+++ b/nimpretty/tests/exhaustive.nim
@@ -676,3 +676,15 @@ block:
 ## single line comment would be ok.
 block:
   var x = 7
+
+
+proc newRecordGen(ctx: Context; typ: TypRef): PNode =
+  result = nkTypeDef.t(
+    newId(typ.optSym.name, true, pragmas = [id(if typ.isUnion: "cUnion" else: "cStruct")]),
+    empty(),
+    nkObjectTy.t(
+      empty(),
+      empty(),
+      nkRecList.t(
+        typ.recFields.map(newRecFieldGen))))
+
diff --git a/nimpretty/tests/expected/exhaustive.nim b/nimpretty/tests/expected/exhaustive.nim
index 4d1b933ef..4ed056656 100644
--- a/nimpretty/tests/expected/exhaustive.nim
+++ b/nimpretty/tests/expected/exhaustive.nim
@@ -682,3 +682,16 @@ block:
 ## single line comment would be ok.
 block:
   var x = 7
+
+
+proc newRecordGen(ctx: Context; typ: TypRef): PNode =
+  result = nkTypeDef.t(
+    newId(typ.optSym.name, true, pragmas = [id(
+        if typ.isUnion: "cUnion" else: "cStruct")]),
+    empty(),
+    nkObjectTy.t(
+      empty(),
+      empty(),
+      nkRecList.t(
+        typ.recFields.map(newRecFieldGen))))
+