Skip to content

Commit

Permalink
Add ternary test
Browse files Browse the repository at this point in the history
  • Loading branch information
N00byEdge committed Nov 19, 2019
1 parent eb440ab commit d7ec8a8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Tests/ASTzerTests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -168,3 +168,11 @@ TEST(ASTizer, TwoArgsSubscript) {
ASTize({randomIdent(), "["_token, randomIdent(), ","_token, randomIdent(), "]"_token, ";"_token}, st);
}

TEST(ASTizer, TernaryOperator) {
Meter::AST::Ternary top{};
Meter::AST::ExpressionStatment est{std::move(top)};
Meter::AST::Statements st;
st.emplace_back(std::move(est));

ASTize({randomIdent(), "?"_token, randomIdent(), ":"_token, randomIdent(), ";"_token}, st);
}

0 comments on commit d7ec8a8

Please sign in to comment.