]> granicus.if.org Git - graphviz/commitdiff
add a test case for #2341
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 21 Jan 2023 19:23:40 +0000 (11:23 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 21 Jan 2023 20:49:54 +0000 (12:49 -0800)
tests/test_regression.py

index 88f25834933c7cae3f49c82bd79eb9487c96e3b5..fd72969a4f55307ab5f5cc33e66dd44ef2974b32 100644 (file)
@@ -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