Skip to content
Snippets Groups Projects
Commit a9d88d98 authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Add tests for ASTNode struct

ASTNode will require a bunch of rework
parent 215f9c08
No related branches found
No related tags found
1 merge request!37Feature/language
......@@ -7,6 +7,7 @@ add_executable (unit_tests
test_ArrayUtils.cpp
test_ASTBuilder.cpp
test_ASTDotPrinter.cpp
test_ASTNode.cpp
test_ASTNodeAffectationExpressionBuilder.cpp
test_ASTNodeBinaryOperatorExpressionBuilder.cpp
test_ASTNodeDataType.cpp
......
#include <catch2/catch.hpp>
#include <ASTNode.hpp>
#include <node_processor/FakeProcessor.hpp>
TEST_CASE("ASTNode", "[language]")
{
rang::setControlMode(rang::control::Off);
SECTION("execute")
{
ASTNode ast_node;
ExecUntilBreakOrContinue exec_policy;
#ifndef NDEBUG
REQUIRE_THROWS(ast_node.execute(exec_policy));
#endif // NDEBUG
ast_node.m_node_processor = std::make_unique<FakeProcessor>();
REQUIRE_NOTHROW(ast_node.execute(exec_policy));
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment