Debian Codegraph @

tests/test_svg_analyzer_penwidth.cpp

raw
1 #include <catch2/catch_all.hpp>
2 #include <format>
3
4 #include "svg_analyzer.h"
5 #include "test_utilities.h"
6
7 TEST_CASE("SvgAnalyzer penwidth",
8 "Test that the SvgAnalyzer can recreate the original SVG with the "
9 "correct `stroke-width` attribute when the Graphviz `penwidth` "
10 "attribute is used for nodes and edges") {
11
12 const auto shape = GENERATE(from_range(all_node_shapes));
13 INFO("Shape: " << shape);
14
15 const auto penwidth = GENERATE(0.5, 1.0, 2.0);
16 INFO("Node and edge penwidth: " << penwidth);
17
18 auto dot = std::format(
19 "digraph g1 {{node [shape={} penwidth={}]; edge [penwidth={}]; a -> b}}",
20 shape, penwidth, penwidth);
21
22 SVGAnalyzer::make_from_dot(dot).re_create_and_verify_svg();
23 }