tprep.nim 649 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. discard """
  2. nimout: '''
  3. tprep.nim(25, 9) Hint: Case 2 [User]
  4. tprep.nim(27, 11) Hint: Case 2.3 [User]
  5. '''
  6. outputsub: ""
  7. """
  8. # Test the features that used to belong to the preprocessor
  9. import
  10. times
  11. #{.warning: "This is only a test warning!".}
  12. const
  13. case2 = true
  14. case3 = true
  15. when defined(case1):
  16. {.hint: "Case 1".}
  17. when case3:
  18. {.hint: "Case 1.3".}
  19. elif case2:
  20. {.hint: "Case 2".}
  21. when case3:
  22. {.hint: "Case 2.3".}
  23. elif case3:
  24. {.hint: "Case 3".}
  25. else:
  26. {.hint: "unknown case".}
  27. var
  28. s: string
  29. write(stdout, "compiled at " & system.CompileDate &
  30. " " & CompileTime & "\n")
  31. echo getDateStr()
  32. echo getClockStr()