From d4865e4d10ae20a8e9e139c1818a945342aaff07 Mon Sep 17 00:00:00 2001 From: sascha Date: Tue, 7 Jul 2026 08:23:43 +0200 Subject: [PATCH] collection proxy progress --- test/core/object/CollectionTest.cpp | 9 +++++++++ test/orm/query/DeleteQueryBuilderTest.cpp | 10 +++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/test/core/object/CollectionTest.cpp b/test/core/object/CollectionTest.cpp index 015e0ae..843e0ed 100644 --- a/test/core/object/CollectionTest.cpp +++ b/test/core/object/CollectionTest.cpp @@ -3,5 +3,14 @@ #include "matador/object/collection.hpp" #include "matador/object/object.hpp" +#include + +using namespace matador::object; + TEST_CASE("Test collection", "[collection]") { + collection ints{{1,2,3,4}}; + + for (auto const& i : ints) { + std::cout << i << std::endl ; + } } \ No newline at end of file diff --git a/test/orm/query/DeleteQueryBuilderTest.cpp b/test/orm/query/DeleteQueryBuilderTest.cpp index 6d71155..bd85157 100644 --- a/test/orm/query/DeleteQueryBuilderTest.cpp +++ b/test/orm/query/DeleteQueryBuilderTest.cpp @@ -72,7 +72,7 @@ TEST_CASE_METHOD(QueryFixture, "Test delete builder has many to many", "[query][ .and_then( [&scm] { return scm.attach("ingredients"); } ); REQUIRE(result.is_ok()); - const std::vector ingredients { + std::vector ingredients { make_object(1, "Apple"), make_object(2, "Strawberry"), make_object(3, "Pineapple"), @@ -82,12 +82,20 @@ TEST_CASE_METHOD(QueryFixture, "Test delete builder has many to many", "[query][ make_object(7, "Beans") }; + for (auto &i : ingredients) { + i.change_state(object_state::Persistent); + } + std::vector recipes { make_object(1, "Apple Pie", std::vector{ingredients[0], ingredients[3], ingredients[4]}), make_object(2, "Strawberry Cake", std::vector{ingredients[5], ingredients[6]}), make_object(3, "Pineapple Pie", std::vector{ingredients[0], ingredients[1], ingredients[2]}) }; + for (auto &r : recipes) { + r.change_state(object_state::Persistent); + } + const auto contexts_by_type = to_contexts_by_name(scm, db->dialect()); delete_query_builder dqb(scm, contexts_by_type);