summaryrefslogtreecommitdiffhomepage
path: root/test-cpp.cpp
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2020-03-27 19:12:44 +0100
committerRoland Reichwein <mail@reichwein.it>2020-03-27 19:12:44 +0100
commit02d391df5cb7a9cefcd6fec62c4392a8557b5dc8 (patch)
treec397ad923b87a8fbbd8669ec421e318c6f228377 /test-cpp.cpp
parent3057729f132d516dd9ed58c6964a495aa1c11c3d (diff)
Fixes
Diffstat (limited to 'test-cpp.cpp')
-rw-r--r--test-cpp.cpp22
1 files changed, 13 insertions, 9 deletions
diff --git a/test-cpp.cpp b/test-cpp.cpp
index 47a57f5..aabc4f4 100644
--- a/test-cpp.cpp
+++ b/test-cpp.cpp
@@ -40,11 +40,6 @@ TEST_F(CppTest, preprocessing_tokenize) {
auto tokens = cpp.tokens_from_pptokens(pp_tokens);
ASSERT_EQ(tokens.size(), 9);
-#if 0
- for (auto &i: tokens) {
- std::cout << i.type << ": " << i.value << std::endl;
- }
-#endif
auto nodes = cpp.analysis(tokens);
@@ -52,14 +47,23 @@ TEST_F(CppTest, preprocessing_tokenize) {
}
#endif
-#if 0
-TEST_F(CppTest, preprocessing_tokenize2) {
+TEST_F(CppTest, preprocessing_tokenize_compile_error) {
CPP cpp;
auto ppTree = cpp.preprocessing_tokenize("in ma");
- cpp.tokens_from_pptokens(ppTree);
+ auto tokens = cpp.tokens_from_pptokens(ppTree);
+
+ ASSERT_EQ(tokens.size(), 2);
+
+ try {
+ auto nodes = cpp.analysis(tokens);
+ } catch (const std::exception& ex) {
+ EXPECT_EQ(ex.what(), "Compile error"s);
+ return;
+ }
+
+ FAIL() << "Exception expected";
}
-#endif
#if 0
TEST(Cpp, translate) {