summary refs log tree commit diff stats
path: root/tests/macros
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2020-05-02 21:16:08 +0200
committerAndreas Rumpf <rumpf_a@web.de>2020-05-02 22:31:19 +0200
commitff1c0bae4c9d375b6f68ab37d3eb24e4e5d15198 (patch)
treedaf98b32fa16d3ab2911ef2bc32614b7f7f7fff0 /tests/macros
parent7f1d2489ad79d09c649e37b6d2db12f5fdbd86d7 (diff)
downloadNim-ff1c0bae4c9d375b6f68ab37d3eb24e4e5d15198.tar.gz
update tests that tested for the 'discard' error messages
Diffstat (limited to 'tests/macros')
-rw-r--r--tests/macros/tmacro6.nim16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/macros/tmacro6.nim b/tests/macros/tmacro6.nim
index 0b6423100..c65d34b6d 100644
--- a/tests/macros/tmacro6.nim
+++ b/tests/macros/tmacro6.nim
@@ -1,22 +1,22 @@
 discard """
-errormsg: "expression '123' is of type 'int literal(123)' and has to be discarded"
+errormsg: "expression '123' is of type 'int literal(123)' and has to be used (or discarded)"
 line: 71
 """
 
 import macros
 
-proc foo(a,b,c: int): int =
+proc foo(a, b, c: int): int =
   result += a
   result += b
   result += c
 
-macro bar(a,b,c: int): int =
+macro bar(a, b, c: int): int =
   result = newCall(ident"echo")
   result.add a
   result.add b
   result.add c
 
-macro baz(a,b,c: int): int =
+macro baz(a, b, c: int): int =
   let stmt = nnkStmtListExpr.newTree()
   stmt.add newCall(ident"echo", a)
   stmt.add newCall(ident"echo", b)
@@ -26,7 +26,7 @@ macro baz(a,b,c: int): int =
 
 # test no result type with explicit return
 
-macro baz2(a,b,c: int) =
+macro baz2(a, b, c: int) =
   let stmt = nnkStmtListExpr.newTree()
   stmt.add newCall(ident"echo", a)
   stmt.add newCall(ident"echo", b)
@@ -35,7 +35,7 @@ macro baz2(a,b,c: int) =
 
 # test explicit void type with explicit return
 
-macro baz3(a,b,c: int): void =
+macro baz3(a, b, c: int): void =
   let stmt = nnkStmtListExpr.newTree()
   stmt.add newCall(ident"echo", a)
   stmt.add newCall(ident"echo", b)
@@ -44,7 +44,7 @@ macro baz3(a,b,c: int): void =
 
 # test no result type with result variable
 
-macro baz4(a,b,c: int) =
+macro baz4(a, b, c: int) =
   result = nnkStmtListExpr.newTree()
   result.add newCall(ident"echo", a)
   result.add newCall(ident"echo", b)
@@ -52,7 +52,7 @@ macro baz4(a,b,c: int) =
 
 # test explicit void type with result variable
 
-macro baz5(a,b,c: int): void =
+macro baz5(a, b, c: int): void =
   let result = nnkStmtListExpr.newTree()
   result.add newCall(ident"echo", a)
   result.add newCall(ident"echo", b)