-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4e3f18b
commit eced5e6
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/** \file drd_info_test.cpp | ||
* \copyright GPLv3 | ||
* \details Unitests for drd data structure | ||
* \author jingkaimori | ||
* \date 2024 | ||
*/ | ||
|
||
#include "moe_doctests.hpp" | ||
#include "moebius\drd\drd_info.hpp" | ||
#include "tree_helper.hpp" | ||
|
||
using namespace moebius; | ||
|
||
using moebius::drd::drd_info; | ||
|
||
TEST_CASE ("drd initialize macro") { | ||
drd_info test_drd ("test"); | ||
test_drd->heuristic_init_macro ( | ||
"test-macro", | ||
tree (MACRO, "arg1", "arg2", | ||
tree (CONCAT, tree (ARG, "arg1"), " text ", tree (ARG, "arg2")))); | ||
tree_label test_macro_label= make_tree_label ("test-macro"); | ||
CHECK_EQ (test_drd->get_arity_base (test_macro_label), 2); | ||
CHECK_EQ (test_drd->get_arity_extra (test_macro_label), 0); | ||
CHECK_EQ (test_drd->get_arity_mode (test_macro_label), ARITY_NORMAL); | ||
CHECK_EQ (test_drd->get_nr_indices (test_macro_label), 2); | ||
} |