37 using Graph = Digraph<char, std::string>;
40 BEAST_EXPECT(!graph.connected(
'a',
'b'));
41 BEAST_EXPECT(!graph.edge(
'a',
'b'));
42 BEAST_EXPECT(!graph.disconnect(
'a',
'b'));
44 BEAST_EXPECT(graph.connect(
'a',
'b',
"foobar"));
45 BEAST_EXPECT(graph.connected(
'a',
'b'));
46 BEAST_EXPECT(*graph.edge(
'a',
'b') ==
"foobar");
48 BEAST_EXPECT(!graph.connect(
'a',
'b',
"repeat"));
49 BEAST_EXPECT(graph.disconnect(
'a',
'b'));
50 BEAST_EXPECT(graph.connect(
'a',
'b',
"repeat"));
51 BEAST_EXPECT(graph.connected(
'a',
'b'));
52 BEAST_EXPECT(*graph.edge(
'a',
'b') ==
"repeat");
54 BEAST_EXPECT(graph.connect(
'a',
'c',
"tree"));
59 for (
auto const& edge : graph.outEdges(
'a'))
67 BEAST_EXPECT(edges == expected);
68 BEAST_EXPECT(graph.outDegree(
'a') == expected.
size());
71 BEAST_EXPECT(graph.outEdges(
'r').size() == 0);
72 BEAST_EXPECT(graph.outDegree(
'r') == 0);
73 BEAST_EXPECT(graph.outDegree(
'c') == 0);
76 BEAST_EXPECT(graph.outVertices().size() == 1);
79 BEAST_EXPECT((graph.outVertices(
'a') == expected));
80 BEAST_EXPECT(graph.outVertices(
'b').size() == 0);
81 BEAST_EXPECT(graph.outVertices(
'c').size() == 0);
82 BEAST_EXPECT(graph.outVertices(
'r').size() == 0);
85 graph.saveDot(ss, [](
char v) {
return v; });
91 BEAST_EXPECT(ss.
str() == expectedDot);