From a008f591e2b318c2c9e12b8923210435d22e8280 Mon Sep 17 00:00:00 2001 From: Timothee Cour Date: Mon, 25 May 2020 02:17:25 -0700 Subject: [PATCH] add test for `define`, `undef` (#14443) --- tests/pragmas/tpragmas_misc.nim | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tests/pragmas/tpragmas_misc.nim diff --git a/tests/pragmas/tpragmas_misc.nim b/tests/pragmas/tpragmas_misc.nim new file mode 100644 index 000000000..247fa471e --- /dev/null +++ b/tests/pragmas/tpragmas_misc.nim @@ -0,0 +1,12 @@ +##[ +tests for misc pragmas that don't need a separate file +]## + +block: + static: doAssert not defined(tpragmas_misc_def) + {.undef(tpragmas_misc_def).} # works even if not set + static: doAssert not defined(tpragmas_misc_def) + {.define(tpragmas_misc_def).} + static: doAssert defined(tpragmas_misc_def) + {.undef(tpragmas_misc_def).} + static: doAssert not defined(tpragmas_misc_def)