diff options
Diffstat (limited to 'tests/pragmas')
-rw-r--r-- | tests/pragmas/twarning_off.nim | 17 | ||||
-rw-r--r-- | tests/pragmas/warn_module.nim | 7 |
2 files changed, 24 insertions, 0 deletions
diff --git a/tests/pragmas/twarning_off.nim b/tests/pragmas/twarning_off.nim new file mode 100644 index 000000000..1b86c6299 --- /dev/null +++ b/tests/pragmas/twarning_off.nim @@ -0,0 +1,17 @@ +discard """ + nimout: ''' +compile start +Hint: warn_module [Processing] +Hint: hashes [Processing] +warn_module.nim(4, 6) Hint: 'test' is declared but not used [XDeclaredButNotUsed] +compile end +''' +""" + +static: + echo "compile start" + +import warn_module + +static: + echo "compile end" diff --git a/tests/pragmas/warn_module.nim b/tests/pragmas/warn_module.nim new file mode 100644 index 000000000..0d1e5f419 --- /dev/null +++ b/tests/pragmas/warn_module.nim @@ -0,0 +1,7 @@ + +{.warning[UnusedImport]: off.} + +import hashes + +proc test(a: float): float = + a |