From: Matthew Fernandez Date: Sat, 19 Jun 2021 16:53:25 +0000 (-0700) Subject: add a test case for #1408 X-Git-Tag: 2.48.0~33^2~9 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e63d47546eade08b6524227dea228e94a4c767e3;p=graphviz add a test case for #1408 --- diff --git a/rtest/1408.dot b/rtest/1408.dot new file mode 100644 index 000000000..18032af49 --- /dev/null +++ b/rtest/1408.dot @@ -0,0 +1,31 @@ +digraph map { + splines=ortho; + layout="dot"; + rankdir="LR"; + + # Clusters + subgraph "cluster_1" { + node [style=filled]; + style=filled; + + label="Cluster 1"; + color="pink"; + + #Nodes + "node1" [fillcolor=red,shape=house] + } + subgraph "cluster_2" { + node [style=filled]; + style=filled; + + label="Cluster 2"; + color="lightblue"; + + #Nodes: + "node2" [fillcolor=red,shape=box3d] + } + + + # Edges + "node2" -> "node1" [color=red,arrowhead=dot] +} diff --git a/rtest/test_regression.py b/rtest/test_regression.py index b134e8962..5c50b7e73 100644 --- a/rtest/test_regression.py +++ b/rtest/test_regression.py @@ -15,6 +15,17 @@ import pytest sys.path.append(os.path.dirname(__file__)) from gvtest import ROOT, run_c #pylint: disable=C0413 +def is_ndebug_defined() -> bool: + """ + are assertions disabled in the Graphviz build under test? + """ + + # the Windows release builds set NDEBUG + if os.environ.get("configuration") == "Release": + return True + + return False + # The terminology used in rtest.py is a little inconsistent. At the # end it reports the total number of tests, the number of "failures" # (crashes) and the number of "changes" (which is the number of tests @@ -219,6 +230,20 @@ def test_1314(): # the execution did not fail as expected pytest.fail("dot incorrectly exited with success") +@pytest.mark.xfail(strict=not is_ndebug_defined()) # FIXME +def test_1408(): + """ + parsing particular ortho layouts should not cause an assertion failure + https://gitlab.com/graphviz/graphviz/-/issues/1408 + """ + + # locate our associated test case in this directory + input = Path(__file__).parent / "1408.dot" + assert input.exists(), "unexpectedly missing test case" + + # process it with Graphviz + subprocess.check_call(["dot", "-Tsvg", "-o", os.devnull, input]) + def test_1411(): """ parsing strings containing newlines should not disrupt line number tracking