diff options
| author | Roland Reichwein <mail@reichwein.it> | 2020-11-17 12:38:40 +0100 | 
|---|---|---|
| committer | Roland Reichwein <mail@reichwein.it> | 2020-11-17 12:38:40 +0100 | 
| commit | 927eb99e75325164a541c2638e1e607294019381 (patch) | |
| tree | 5b5476456f0f957fc7492465ff08ace54e1a9e48 /tests | |
| parent | c9cb051fae190acfc36813e4a23759fb9b9c3df3 (diff) | |
Complete hierarchical evaluation (unittest and systemtest fixed)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test-cpp.cpp | 30 | 
1 files changed, 27 insertions, 3 deletions
| diff --git a/tests/test-cpp.cpp b/tests/test-cpp.cpp index 5755516..95d271d 100644 --- a/tests/test-cpp.cpp +++ b/tests/test-cpp.cpp @@ -80,16 +80,40 @@ TEST_F(CppTest, preprocessing_tokenize_compile_error) {   FAIL() << "Exception expected";  } -TEST_F(CppTest, compile) { +TEST_F(CppTest, compile_1) { + CPP cpp; +  + cpp.compile("int main() { return 1; }"); +} + +TEST_F(CppTest, compile_add) {   CPP cpp;   cpp.compile("int main() { return 1 + 2; }");  } -TEST_F(CppTest, compile_1) { +TEST_F(CppTest, compile_123) {   CPP cpp; - cpp.compile("int main() { return 1; }"); + cpp.compile("int main() { return 1 + 2 + 3; }"); +} + +TEST_F(CppTest, compile_parentheses_left) { + CPP cpp; +  + cpp.compile("int main() { return (3 + 1) + 2; }"); +} + +TEST_F(CppTest, compile_parentheses_right) { + CPP cpp; +  + cpp.compile("int main() { return 3 + (1 + 2); }"); +} + +TEST_F(CppTest, compile_add_mul) { + CPP cpp; +  + cpp.compile("int main() { return 1 + (2 * 2); }");  }  TEST_F(CppTest, compile_2_times) { | 
