From 09c9538d26246c6fc29c0f010e1693f8188b6e23 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sat, 19 Mar 2022 10:38:56 -0700 Subject: [PATCH] add a test case for #2215 --- rtest/test_regression.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/rtest/test_regression.py b/rtest/test_regression.py index c80b03e35..50a390acb 100644 --- a/rtest/test_regression.py +++ b/rtest/test_regression.py @@ -1573,6 +1573,22 @@ def test_2211(): "index: 3 should be 3\n" \ "index: -1 should be -1\n" +def test_2215(): + """ + Graphviz should not crash with `-v` + https://gitlab.com/graphviz/graphviz/-/issues/2215 + """ + + # try it on a simple graph + input = "graph g { a -- b; }" + subprocess.run(["dot", "-v"], input=input, check=True, + universal_newlines=True) + + # try the same on a labelled version of this graph + input = 'graph g { node[label=""] a -- b; }' + subprocess.run(["dot", "-v"], input=input, check=True, + universal_newlines=True) + def test_package_version(): """ The graphviz_version.h header should define a non-empty PACKAGE_VERSION -- 2.40.0