From 8cbe9edeeed6f99909b20ce13d4139f8727ef4b0 Mon Sep 17 00:00:00 2001 From: Magnus Jacobsson Date: Wed, 17 Aug 2022 22:10:28 +0200 Subject: [PATCH] tests: test_rankdir: add checking of relative position of edge and each node --- tests/test_rankdir.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/test_rankdir.cpp b/tests/test_rankdir.cpp index 16f4c885c..e023c39d0 100644 --- a/tests/test_rankdir.cpp +++ b/tests/test_rankdir.cpp @@ -44,11 +44,19 @@ TEST_CASE("Graph rankdir", "Test that the Graphviz `rankdir` attribute affects " const auto edge_ab = graph.edge("a->b"); if (rankdir == "TB") { CHECK(node_a.center().is_higher_than(node_b.center())); + CHECK(node_a.center().is_higher_than(edge_ab.center())); + CHECK(edge_ab.center().is_higher_than(node_b.center())); } else if (rankdir == "BT") { CHECK(node_a.center().is_lower_than(node_b.center())); + CHECK(node_a.center().is_lower_than(edge_ab.center())); + CHECK(edge_ab.center().is_lower_than(node_b.center())); } else if (rankdir == "LR") { CHECK(node_a.center().is_more_left_than(node_b.center())); + CHECK(node_a.center().is_more_left_than(edge_ab.center())); + CHECK(edge_ab.center().is_more_left_than(node_b.center())); } else if (rankdir == "RL") { CHECK(node_a.center().is_more_right_than(node_b.center())); + CHECK(node_a.center().is_more_right_than(edge_ab.center())); + CHECK(edge_ab.center().is_more_right_than(node_b.center())); } } -- 2.40.0