summaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authorShevek <[email protected]>2014-09-11 12:20:05 -0700
committerShevek <[email protected]>2014-09-11 12:20:05 -0700
commitcccd60f37a31113a42372672670ce2a2bc529684 (patch)
tree479b0bb354da25cdb8707e8b27baa49e2f9b12c5 /src/test
parent2db1eafd535d8db92f76db8ccf45b1b80f6152e3 (diff)
Handle conditionals in preprocessor statements.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/org/anarres/cpp/PreprocessorTest.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/test/java/org/anarres/cpp/PreprocessorTest.java b/src/test/java/org/anarres/cpp/PreprocessorTest.java
index 8a40823..84e7e31 100644
--- a/src/test/java/org/anarres/cpp/PreprocessorTest.java
+++ b/src/test/java/org/anarres/cpp/PreprocessorTest.java
@@ -153,6 +153,10 @@ public class PreprocessorTest {
testInput("LStr(x);\n", NL, I("L"), "x", ';');
testInput("'foo'\n", NL, SQSTRING);
+ testInput("#if 1 ? 2 : 0\nTEXT\n#endif\n", NL, NL, I("TEXT"), NL);
+ testInput("#if 1 ? 0 : 2\nTEXT\n#endif\n", NL, NL, NL);
+ testInput("#if 0 ? 0 : 2\nTEXT\n#endif\n", NL, NL, I("TEXT"), NL);
+ testInput("#if 0 ? 2 : 0\nTEXT\n#endif\n", NL, NL, NL);
writer.close();