summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorTimothee Cour <timothee.cour2@gmail.com>2021-05-26 00:46:53 -0700
committerGitHub <noreply@github.com>2021-05-26 09:46:53 +0200
commit0b2bbcaa23f91b06bc06dd2cf35d4d26a6d24aa8 (patch)
treeb33d5cdc7feba1a76c4c51fb41297b9d94be89f5 /tests
parent8df55d0ad735277683631bb8e5966ee75545de2b (diff)
downloadNim-0b2bbcaa23f91b06bc06dd2cf35d4d26a6d24aa8.tar.gz
fix #18077 testament now parses `cmd` properly (#18086)
Diffstat (limited to 'tests')
-rw-r--r--tests/misc/t18077.nim21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/misc/t18077.nim b/tests/misc/t18077.nim
new file mode 100644
index 000000000..6cd05d575
--- /dev/null
+++ b/tests/misc/t18077.nim
@@ -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)