]> granicus.if.org Git - graphviz/commitdiff
add a test case for #2179
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Tue, 1 Feb 2022 10:21:05 +0000 (21:21 +1100)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 4 Feb 2022 05:58:19 +0000 (16:58 +1100)
rtest/test_regression.py

index a9e84c646596433d6ae88f2109bc9f78b128f4e3..5f41c54c3a214856cd9e9504d728e6984fe7f453 100644 (file)
@@ -1312,6 +1312,29 @@ def test_2138(examine: str):
     assert "// tok[7]    >>012<<   should NOT include trailing spaces or "     \
       "junk chars" in result, "token 012 not found or has trailing garbage"
 
+@pytest.mark.xfail(strict=True) # FIXME
+def test_2179():
+  """
+  processing a label with an empty line should not yield a warning
+  https://gitlab.com/graphviz/graphviz/-/issues/2179
+  """
+
+  # a graph containing a label with an empty line
+  input = 'digraph "" {\n' \
+          '  0 -> 1 [fontname="Lato",label=<<br/>1>]\n' \
+          '}'
+
+  # run a graph with an empty label through Graphviz
+  with subprocess.Popen(["dot", "-Tsvg", "-o", os.devnull],
+                        stdin=subprocess.PIPE, stderr=subprocess.PIPE,
+                        universal_newlines=True) as p:
+    _, stderr = p.communicate(input)
+
+    assert p.returncode == 0
+
+  assert "Warning: no hard-coded metrics for" not in stderr, \
+    "incorrect warning triggered"
+
 def test_package_version():
   """
   The graphviz_version.h header should define a non-empty PACKAGE_VERSION