| 1 |
#include <format> |
| 2 |
#include <string> |
| 3 |
|
| 4 |
#include <catch2/catch_all.hpp> |
| 5 |
|
| 6 |
#include "test_edge_node_overlap_utilities.h" |
| 7 |
#include "test_utilities.h" |
| 8 |
|
| 9 |
// FIXME: this test fails for all primitive arrow types except `normal` and |
| 10 |
// `inv` which currently are the only ones fixed for penwidth and for the 'l' |
| 11 |
// and 'r' arrow shape modifiers which do not yet handle the miter point |
| 12 |
// correctly |
| 13 |
|
| 14 |
TEST_CASE("Edge node overlap for all arrow shapes", |
| 15 |
"An edge connected to a node shall touch that node and not overlap " |
| 16 |
"it too much, regardless of the arrow shape") { |
| 17 |
|
| 18 |
std::string filename_base = AUTO_NAME(); |
| 19 |
|
| 20 |
const auto primitive_arrow_shape = |
| 21 |
GENERATE(from_range(all_primitive_arrow_shapes)); |
| 22 |
INFO("Edge primitive arrow shape: " << primitive_arrow_shape); |
| 23 |
|
| 24 |
const auto arrow_shape_modifier = |
| 25 |
GENERATE(from_range(all_arrow_shape_modifiers)); |
| 26 |
INFO("Edge arrow shape modifier: " << arrow_shape_modifier); |
| 27 |
|
| 28 |
const auto arrow_shape = |
| 29 |
std::format("{}{}", arrow_shape_modifier, primitive_arrow_shape); |
| 30 |
INFO("Edge arrow shape: " << arrow_shape); |
| 31 |
filename_base += std::format("_arrow_shape_{}", arrow_shape); |
| 32 |
|
| 33 |
const graph_options graph_options = { |
| 34 |
.node_shape = "polygon", |
| 35 |
.node_penwidth = 2, |
| 36 |
.dir = "both", |
| 37 |
.edge_penwidth = 2, |
| 38 |
.primitive_arrowhead_shape = primitive_arrow_shape, |
| 39 |
.primitive_arrowtail_shape = primitive_arrow_shape, |
| 40 |
.arrowhead_modifier = arrow_shape_modifier, |
| 41 |
.arrowtail_modifier = arrow_shape_modifier, |
| 42 |
}; |
| 43 |
|
| 44 |
test_edge_node_overlap(graph_options, {}, {.filename_base = filename_base}); |
| 45 |
} |