diff options
author | Roland Reichwein <mail@reichwein.it> | 2020-11-01 16:26:22 +0100 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2020-11-01 16:26:22 +0100 |
commit | e0d6dac4b103a557b37f4850fe76dacf87df7cb9 (patch) | |
tree | 76cd488c6eb59d0e42639b0abcf623d311a07c4c /tests/test-cpp.cpp | |
parent | 8256280b348b4b53fff35c9101ced0a8dfb2c58e (diff) |
Update cppbnf.cpp
Diffstat (limited to 'tests/test-cpp.cpp')
-rw-r--r-- | tests/test-cpp.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/tests/test-cpp.cpp b/tests/test-cpp.cpp index e5b2a1a..adfa54b 100644 --- a/tests/test-cpp.cpp +++ b/tests/test-cpp.cpp @@ -24,7 +24,7 @@ class CppTest: public ::testing::Test { protected: CppTest() { - //debug = true; + debug = true; } ~CppTest() { } @@ -42,7 +42,22 @@ TEST_F(CppTest, preprocessing_tokenize) { auto nodes = cpp.analysis(tokens); - ASSERT_EQ(nodes.size(), 60/*44*/); + ASSERT_EQ(nodes.size(), 58/*44*/); +} + +TEST_F(CppTest, preprocessing_tokenize_empty) { + CPP cpp; + auto pp_tokens = cpp.preprocessing_tokenize(""); + + ASSERT_EQ(pp_tokens.size(), 0); + + auto tokens = cpp.tokens_from_pptokens(pp_tokens); + + ASSERT_EQ(tokens.size(), 0); + + auto nodes = cpp.analysis(tokens); + + ASSERT_EQ(nodes.size(), 0); } TEST_F(CppTest, preprocessing_tokenize_compile_error) { |