summary refs log tree commit diff stats
path: root/nimpretty/tests/expected
diff options
context:
space:
mode:
Diffstat (limited to 'nimpretty/tests/expected')
-rw-r--r--nimpretty/tests/expected/exhaustive.nim48
-rw-r--r--nimpretty/tests/expected/simple.nim16
-rw-r--r--nimpretty/tests/expected/wrong_ind.nim2
3 files changed, 54 insertions, 12 deletions
diff --git a/nimpretty/tests/expected/exhaustive.nim b/nimpretty/tests/expected/exhaustive.nim
index 3c2355707..7f78b7e56 100644
--- a/nimpretty/tests/expected/exhaustive.nim
+++ b/nimpretty/tests/expected/exhaustive.nim
@@ -1,5 +1,5 @@
 discard """
-  outputsub: '''ObjectAssignmentError'''
+  outputsub: '''ObjectAssignmentDefect'''
   exitcode: "1"
 """
 
@@ -272,7 +272,7 @@ proc emitTok*(em: var Emitter; L: TLexer; tok: TToken) =
     if not em.endsInWhite: wr(" ")
     wr(tok.ident.s)
     template isUnary(tok): bool =
-      tok.strongSpaceB == 0 and tok.strongSpaceA > 0
+      tok.spacing == {tsLeading}
 
     if not isUnary(tok) or em.lastTok in {tkOpr, tkDotDot}:
       wr(" ")
@@ -423,9 +423,9 @@ proc isValid1*[A](s: HashSet[A]): bool {.deprecated:
   result = s.data.len > 0
   # bug #11468
 
-assert $type(a) == "Option[system.int]"
-foo(a, $type(b), c)
-foo(type(b), c) # this is ok
+assert $typeof(a) == "Option[system.int]"
+foo(a, $typeof(b), c)
+foo(typeof(b), c) # this is ok
 
 proc `<`*[A](s, t: A): bool = discard
 proc `==`*[A](s, t: HashSet[A]): bool = discard
@@ -699,11 +699,11 @@ proc newRecordGen(ctx: Context; typ: TypRef): PNode =
 String `interpolation`:idx: / `format`:idx: inspired by
 Python's ``f``-strings.
 
-.. code-block:: nim
-
-    import strformat
-    let msg = "hello"
-    doAssert fmt"{msg}\n" == "hello\\n"
+  ```nim
+  import strformat
+  let msg = "hello"
+  doAssert fmt"{msg}\n" == "hello\\n"
+  ```
 
 Because the literal is a raw string literal, the ``\n`` is not interpreted as
 an escape sequence.
@@ -812,7 +812,7 @@ let foo = if cond:
 
 let a =
   [[aaadsfas, bbb],
-    [ccc, ddd]]
+   [ccc, ddd]]
 
 let b = [
   [aaa, bbb],
@@ -835,3 +835,29 @@ 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
+
+
+proc hid_open*(vendor_id: cushort; product_id: cushort;
+    serial_number: cstring): ptr HidDevice {.
+    importc: "hid_open", dynlib: hidapi.}
diff --git a/nimpretty/tests/expected/simple.nim b/nimpretty/tests/expected/simple.nim
index 5126658ea..e711eb3b6 100644
--- a/nimpretty/tests/expected/simple.nim
+++ b/nimpretty/tests/expected/simple.nim
@@ -11,3 +11,19 @@ proc a() =
 
   # comment 2
   discard
+
+# bug #15596
+discard ## comment 3
+
+discard # comment 4
+
+
+# bug #20553
+
+let `'hello` = 12
+echo `'hello`
+
+
+proc `'u4`(n: string) =
+  # The leading ' is required.
+  discard
diff --git a/nimpretty/tests/expected/wrong_ind.nim b/nimpretty/tests/expected/wrong_ind.nim
index 95a35a8fd..3ff9de91c 100644
--- a/nimpretty/tests/expected/wrong_ind.nim
+++ b/nimpretty/tests/expected/wrong_ind.nim
@@ -2,7 +2,7 @@
 # bug #9505
 
 import std/[
-    strutils, ospaths, os
+    strutils, os
 ]
 import pkg/[
   regex