initial matador ng commit

This commit is contained in:
2025-02-02 20:37:12 +01:00
parent 19de5714f4
commit ded3daceb3
378 changed files with 14913 additions and 13431 deletions
+35
View File
@@ -0,0 +1,35 @@
#include <catch2/catch_test_macros.hpp>
#include "matador/object/schema.hpp"
struct node {};
using namespace matador;
struct person {
virtual ~person() = default;
};
struct student final : person {};
struct teacher final : person {};
TEST_CASE("Test empty prototype tree", "[prototype_tree][empty]") {
const object::schema tree;
REQUIRE( tree.empty() );
}
TEST_CASE("Test add type to prototype tree", "[prototype_tree][add]") {
object::schema tree;
REQUIRE( tree.empty() );
auto res = tree.attach<person>("person");
REQUIRE( res.is_ok() );
res = tree.attach<student, person>("student");
REQUIRE( res.is_ok() );
res = tree.attach<teacher, person>("teacher");
REQUIRE( res.is_ok() );
REQUIRE( tree.size() == 3 );
}