Graphle 1.0.0
A C++20 header-only graph library
Loading...
Searching...
No Matches
visitor.cpp
Go to the documentation of this file.
1#include <test_framework.hpp>
3
4
5struct vertex {};
6
7
12TEST(search_visitor, from_arguments_empty) {
13 auto g = graphle::graph {
14 .deduce_vertex_type = graphle::meta::deduce_as<vertex>
15 };
16
19 };
20
21 ASSERT_TRUE(graphle::search::search_visitor_type<decltype(v), decltype(g)>);
22}
23
24
29TEST(search_visitor, from_arguments_mono) {
30 auto g = graphle::graph {
31 .deduce_vertex_type = graphle::meta::deduce_as<vertex>
32 };
33
36 .discover_vertex = [] (auto v, auto& g) {}
37 };
38
39 ASSERT_TRUE(graphle::search::search_visitor_type<decltype(v), decltype(g)>);
40}
41
42
47TEST(search_visitor, from_arguments_all) {
48 auto g = graphle::graph {
49 .deduce_vertex_type = graphle::meta::deduce_as<vertex>
50 };
51
54 .discover_vertex = [] (auto v, auto& g) {},
55 .discover_leaf = [] (auto v, auto& g) {},
56 .discover_branch = [] (auto v, auto& g) {},
57 .discover_new_edge = [] (auto e, auto& g) {},
58 .discover_seen_edge = [] (auto e, auto& g) {},
59 .begin_search = [] (auto& g) {},
60 .finish_search = [] (auto& g) {}
61 };
62
63 ASSERT_TRUE(graphle::search::search_visitor_type<decltype(v), decltype(g)>);
64}
constexpr deduce_as_t< T > deduce_as
Definition: value.hpp:32
meta::deduce_as_t< Vertex > deduce_vertex_type
Definition: graph.hpp:73
meta::deduce_as_t< Graph > deduce_graph_type
Definition: visitor.hpp:154
#define TEST(Suite, Name)
#define ASSERT_TRUE(...)