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

Add missing tests for ASTCheckpoint

parent 01187c21
No related branches found
No related tags found
1 merge request!199Integrate checkpointing
......@@ -18,6 +18,7 @@ add_executable (unit_tests
test_Array.cpp
test_ArraySubscriptProcessor.cpp
test_ASTBuilder.cpp
test_ASTCheckpoint.cpp
test_ASTDotPrinter.cpp
test_ASTExecutionStack.cpp
test_ASTModulesImporter.cpp
......
#include <catch2/catch_test_macros.hpp>
#include <catch2/matchers/catch_matchers_all.hpp>
#include <language/ast/ASTNode.hpp>
#include <language/utils/ASTCheckpoint.hpp>
// clazy:excludeall=non-pod-global-static
TEST_CASE("ASTCheckpoint", "[language]")
{
ASTNode ast_node;
std::vector<size_t> location = {1, 2, 4};
ASTCheckpoint cp{location, &ast_node};
REQUIRE(&cp.node() == &ast_node);
REQUIRE(cp.getASTLocation() == location);
ASTCheckpoint cp_copy = cp;
REQUIRE(&cp_copy.node() == &ast_node);
REQUIRE(cp_copy.getASTLocation() == location);
ASTCheckpoint cp_move = std::move(cp);
REQUIRE(&cp_move.node() == &ast_node);
REQUIRE(cp_move.getASTLocation() == location);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment