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

Add unit test for ASTNode::name

parent f2bb8697
No related branches found
No related tags found
1 merge request!37Feature/language
......@@ -24,6 +24,7 @@ struct ASTNode : public parse_tree::basic_node<ASTNode>
ASTNodeDataType m_data_type{ASTNodeDataType::undefined_t};
ASTNodeDataVariant m_value;
PUGS_INLINE
std::string
name() const noexcept
{
......
......@@ -3,6 +3,9 @@
#include <ASTNode.hpp>
#include <node_processor/FakeProcessor.hpp>
#include <Demangle.hpp>
#include <PEGGrammar.hpp>
TEST_CASE("ASTNode", "[language]")
{
rang::setControlMode(rang::control::Off);
......@@ -19,4 +22,14 @@ TEST_CASE("ASTNode", "[language]")
REQUIRE_NOTHROW(ast_node.execute(exec_policy));
}
SECTION("name")
{
ASTNode ast_node;
ExecUntilBreakOrContinue exec_policy;
ast_node.set_type<language::name>();
REQUIRE(ast_node.name() == demangle<language::name>());
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment