]> granicus.if.org Git - graphviz/commitdiff
add a test case for #2215
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 19 Mar 2022 17:38:56 +0000 (10:38 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 26 Mar 2022 00:22:36 +0000 (17:22 -0700)
rtest/test_regression.py

index c80b03e35b38be9248fa46e059743f34a6301cae..50a390acb5a8471de222898d4d8ce05231f5fbf4 100644 (file)
@@ -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