summary refs log tree commit diff stats
path: root/tests/misc/tprep.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/misc/tprep.nim')
-rw-r--r--tests/misc/tprep.nim38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/misc/tprep.nim b/tests/misc/tprep.nim
new file mode 100644
index 000000000..45f25b790
--- /dev/null
+++ b/tests/misc/tprep.nim
@@ -0,0 +1,38 @@
+discard """
+nimout: '''
+tprep.nim(25, 9) Hint: Case 2 [User]
+tprep.nim(27, 11) Hint: Case 2.3 [User]
+'''
+outputsub: ""
+"""
+
+# Test the features that used to belong to the preprocessor
+
+import
+  times
+
+#{.warning: "This is only a test warning!".}
+
+const
+  case2 = true
+  case3 = true
+
+when defined(case1):
+  {.hint: "Case 1".}
+  when case3:
+    {.hint: "Case 1.3".}
+elif case2:
+  {.hint: "Case 2".}
+  when case3:
+    {.hint: "Case 2.3".}
+elif case3:
+  {.hint: "Case 3".}
+else:
+  {.hint: "unknown case".}
+
+var
+  s: string
+write(stdout, "compiled at " & system.CompileDate &
+              " " & CompileTime & "\n")
+echo getDateStr()
+echo getClockStr()