]> granicus.if.org Git - graphviz/commitdiff
Regression test for issue 1902
authorRob Hart <robhart@google.com>
Tue, 8 Dec 2020 16:29:53 +0000 (08:29 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 19 Feb 2022 02:07:44 +0000 (18:07 -0800)
Edit from Matt: Added `xfail` marker as I have reordered the commits to put this
test case introduction before its fix, as well as aligning with current Pylint
requirements.

Gitlab: #1902

Co-authored-by: Matthew Fernandez <matthew.fernandez@gmail.com>
rtest/1902.dot [new file with mode: 0644]
rtest/test_regression.py

diff --git a/rtest/1902.dot b/rtest/1902.dot
new file mode 100644 (file)
index 0000000..634fd03
--- /dev/null
@@ -0,0 +1,10 @@
+digraph {
+  nslimit1=0
+  subgraph cluster {
+    subgraph cluster {
+      a1 ->a2 a3
+    }
+    b1
+    b2->a1
+  } -> a3
+}
\ No newline at end of file
index f85396fca1dd5e86404fc2701e1d7dcb65e8d33f..43a62646b750cf6d1a990e54d5bfc78632665ab5 100644 (file)
@@ -791,6 +791,21 @@ def test_1898():
   # has been reintroduced
   dot("svg", input)
 
+@pytest.mark.xfail(strict=not is_ndebug_defined()) # FIXME
+def test_1902():
+  '''
+  test a segfault from https://gitlab.com/graphviz/graphviz/-/issues/1902 has
+  not reappeared
+  '''
+
+  # locate our associated test case in this directory
+  input = os.path.join(os.path.dirname(__file__), '1902.dot')
+  assert os.path.exists(input), 'unexpectedly missing test case'
+
+  # ask Graphviz to process it, which should generate a segfault if this bug
+  # has been reintroduced
+  subprocess.check_call(['dot', '-Tsvg', '-o', os.devnull, input])
+
 # root directory of this checkout
 ROOT = Path(__file__).parent.parent.resolve()