| 1 |
#include <format> |
| 2 |
#include <string> |
| 3 |
#include <string_view> |
| 4 |
|
| 5 |
#include <catch2/catch_all.hpp> |
| 6 |
|
| 7 |
#include "test_edge_node_overlap_utilities.h" |
| 8 |
#include "test_utilities.h" |
| 9 |
|
| 10 |
TEST_CASE("Edge node overlap for crow and vee arrow", |
| 11 |
"An edge connected to a node shall touch that node and not overlap " |
| 12 |
"it too much") { |
| 13 |
|
| 14 |
std::string filename_base = AUTO_NAME(); |
| 15 |
|
| 16 |
const std::string_view primitive_arrow_shape = GENERATE("crow", "vee"); |
| 17 |
const auto arrow_shape_modifier = |
| 18 |
GENERATE(from_range(all_arrow_shape_modifiers)); |
| 19 |
INFO("Edge arrow shape modifier: " << arrow_shape_modifier); |
| 20 |
|
| 21 |
const auto arrow_shape = |
| 22 |
std::format("{}{}", arrow_shape_modifier, primitive_arrow_shape); |
| 23 |
INFO("Edge arrowhead: " << arrow_shape); |
| 24 |
filename_base += std::format("_arrow_shape_{}", arrow_shape); |
| 25 |
|
| 26 |
const auto rankdir = GENERATE(from_range(all_rank_directions)); |
| 27 |
INFO("Rank direction: " << rankdir); |
| 28 |
filename_base += std::format("_rankdir_{}", rankdir); |
| 29 |
|
| 30 |
const graph_options graph_options = { |
| 31 |
.rankdir = rankdir, |
| 32 |
.node_shape = "polygon", |
| 33 |
.node_penwidth = 2, |
| 34 |
.dir = "both", |
| 35 |
.edge_penwidth = 2, |
| 36 |
.primitive_arrowhead_shape = primitive_arrow_shape, |
| 37 |
.primitive_arrowtail_shape = primitive_arrow_shape, |
| 38 |
.arrowhead_modifier = arrow_shape_modifier, |
| 39 |
.arrowtail_modifier = arrow_shape_modifier, |
| 40 |
}; |
| 41 |
|
| 42 |
test_edge_node_overlap(graph_options, {}, {.filename_base = filename_base}); |
| 43 |
} |