diff --git a/testpreprocessor.cpp b/testpreprocessor.cpp index b0a21aaab..25072decb 100644 --- a/testpreprocessor.cpp +++ b/testpreprocessor.cpp @@ -49,6 +49,8 @@ private: TEST_CASE( if1 ); TEST_CASE( include1 ); + + TEST_CASE( if_cond1 ); } bool cmpmaps(const std::map &m1, const std::map &m2) @@ -278,6 +280,30 @@ private: ASSERT_EQUALS( true, cmpmaps(actual, expected)); } + + + + void if_cond1() + { + const char filedata[] = "#if LIBVER>100\n" + " A\n" + "#else\n" + " B\n" + "#endif\n"; + + // TODO: What should the result be? + std::map expected; + expected[""] = filedata; + + // Preprocess => actual result.. + std::istringstream istr(filedata); + std::map actual; + preprocess( istr, actual ); + + // Compare results.. + ASSERT_EQUALS( true, cmpmaps(actual, expected)); + } + }; REGISTER_TEST( TestPreprocessor )