From 9b61fc11c2945d812374d6aad4c5bab45c7c3214 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Tue, 1 Feb 2022 21:21:05 +1100 Subject: [PATCH] add a test case for #2179 --- rtest/test_regression.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/rtest/test_regression.py b/rtest/test_regression.py index a9e84c646..5f41c54c3 100644 --- a/rtest/test_regression.py +++ b/rtest/test_regression.py @@ -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=<
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 -- 2.40.0