mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-18 05:20:31 +00:00
add test
This commit is contained in:
@@ -321,8 +321,12 @@ proc processNote(c: PContext, n: PNode) =
|
||||
|
||||
let x = c.semConstBoolExpr(c, n[1])
|
||||
n.sons[1] = x
|
||||
if x.kind == nkIntLit and x.intVal != 0: incl(c.config.notes, nk)
|
||||
else: excl(c.config.notes, nk)
|
||||
if x.kind == nkIntLit and x.intVal != 0:
|
||||
incl(c.config.notes, nk)
|
||||
incl(c.optionStack[^1].notes, nk)
|
||||
else:
|
||||
excl(c.config.notes, nk)
|
||||
excl(c.optionStack[^1].notes, nk)
|
||||
else:
|
||||
invalidPragma(c, n)
|
||||
|
||||
|
||||
17
tests/pragmas/twarning_off.nim
Normal file
17
tests/pragmas/twarning_off.nim
Normal file
@@ -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"
|
||||
7
tests/pragmas/warn_module.nim
Normal file
7
tests/pragmas/warn_module.nim
Normal file
@@ -0,0 +1,7 @@
|
||||
|
||||
{.warning[UnusedImport]: off.}
|
||||
|
||||
import hashes
|
||||
|
||||
proc test(a: float): float =
|
||||
a
|
||||
Reference in New Issue
Block a user