Beispiel #1
0
TEST_F(ExpressionTest, parseExpression4) {
  static const std::string expression = "(0 & ((0 | 1) & 1)) & 0";
  static const std::string result = "&()&C()&()|CCCC";
  auto operation = Expression().makeOperation(expression);
  SyntaxTree visitor;
  operation->accept(visitor);
  EXPECT_STREQ(result.c_str(), visitor.result().c_str());
}
Beispiel #2
0
TEST_F(ExpressionTest, parseExpression3) {
  static const std::string expression = "0 | (1 | 0 & 1) & 1";
  static const std::string result = "|C&()|C&CCC";
  auto operation = Expression().makeOperation(expression);
  SyntaxTree visitor;
  operation->accept(visitor);
  EXPECT_STREQ(result.c_str(), visitor.result().c_str());
}