From 941328943d935ddaaf9b65de9c48e7b17e95adc4 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sat, 21 Jan 2023 11:23:40 -0800 Subject: [PATCH] add a test case for #2341 --- tests/test_regression.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/test_regression.py b/tests/test_regression.py index 88f258349..fd72969a4 100644 --- a/tests/test_regression.py +++ b/tests/test_regression.py @@ -10,6 +10,7 @@ import os from pathlib import Path import platform import re +import shutil import signal import stat import subprocess @@ -2081,6 +2082,28 @@ def test_2325(): # run it through Graphviz dot("svg", input) +@pytest.mark.skipif(shutil.which("groff") is None, reason="groff not available") +@pytest.mark.xfail(strict=True) +def test_2341(): + """ + PIC backend should generate correct comments + https://gitlab.com/graphviz/graphviz/-/issues/2341 + """ + + # a simple graph + source = "digraph { a -> b; }" + + # generate PIC from this + pic = dot("pic", source=source) + + # run this through groff + groffed = subprocess.check_output(["groff", "-Tascii", "-p"], input=pic, + universal_newlines=True) + + # it should not contain any comments + assert re.search(r"^\s*#", groffed) is None, \ + "Graphviz comment remains in groff output" + def test_changelog_dates(): """ Check the dates of releases in the changelog are correctly formatted -- 2.50.1