summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/pure/strformat.nim4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/pure/strformat.nim b/lib/pure/strformat.nim
index ce3439600..247d0a296 100644
--- a/lib/pure/strformat.nim
+++ b/lib/pure/strformat.nim
@@ -705,6 +705,6 @@ macro `&`*(pattern: string{lit}): string =
   runnableExamples:
     let x = 7
     assert &"{x}\n" == "7\n" # regular string literal
-    assert &"{x}\n" == "7\n".fmt # `fmt` can be used instead
-    assert &"{x}\n" != fmt"7\n" # see `fmt` docs, this would use a raw string literal
+    assert &"{x}\n" == "{x}\n".fmt # `fmt` can be used instead
+    assert &"{x}\n" != fmt"{x}\n" # see `fmt` docs, this would use a raw string literal
   strformatImpl(pattern.strVal, '{', '}')