From: Matthew Fernandez Date: Fri, 25 Feb 2022 04:09:14 +0000 (-0800) Subject: add a test case for #191 X-Git-Tag: 3.0.0~1^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=15064dbe14980cd72ded328939f95401505da68e;p=graphviz add a test case for #191 --- diff --git a/rtest/test_regression.py b/rtest/test_regression.py index 1809dfbb5..47cd0723b 100644 --- a/rtest/test_regression.py +++ b/rtest/test_regression.py @@ -269,6 +269,26 @@ def test_167(): # Graphviz should not have caused a segfault assert ret != -signal.SIGSEGV, "Graphviz segfaulted" +def test_191(): + """ + a comma-separated list without quotes should cause a hard error, not a warning + https://gitlab.com/graphviz/graphviz/-/issues/191 + """ + + source = 'graph {\n' \ + ' "Trackable" [fontcolor=grey45,labelloc=c,fontname=Vera Sans, ' \ + 'DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,shape=box,' \ + 'height=0.3,align=center,fontsize=10,style="setlinewidth(0.5)"];\n' \ + '}' + + with subprocess.Popen(["dot", "-Tdot"], stdin=subprocess.PIPE, + stderr=subprocess.PIPE, universal_newlines=True) as p: + _, stderr = p.communicate(source) + + assert "syntax error" in stderr, "missing error message for unquoted list" + + assert p.returncode != 0, "syntax error was only a warning, not an error" + @pytest.mark.skipif(shutil.which("gv2gxl") is None or shutil.which("gxl2gv") is None, reason="GXL tools not available")