fix #18077 testament now parses cmd properly (#18086)

This commit is contained in:
Timothee Cour
2021-05-26 00:46:53 -07:00
committed by GitHub
parent 8df55d0ad7
commit 0b2bbcaa23
3 changed files with 61 additions and 16 deletions

21
tests/misc/t18077.nim Normal file
View File

@@ -0,0 +1,21 @@
discard """
cmd: '''nim doc -d:nimTestsT18077b:4 --doccmd:"-d:nimTestsT18077 -d:nimTestsT18077b:3 --hints:off" $file'''
action: compile
"""
# bug #18077
const nimTestsT18077b {.intdefine.} = 1
static:
when defined(nimdoc):
doAssert nimTestsT18077b == 4
doAssert not defined(nimTestsT18077)
else:
doAssert defined(nimTestsT18077)
doAssert nimTestsT18077b == 3
runnableExamples:
const nimTestsT18077b {.intdefine.} = 2
doAssert nimTestsT18077b == 3
doAssert defined(nimTestsT18077)