From: Matthew Fernandez Date: Tue, 27 Sep 2022 02:43:19 +0000 (-0700) Subject: add a test case for #2282 X-Git-Tag: 6.0.2~26^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3bd1c8014ba2318384d21db48455d8ebb01a6ef3;p=graphviz add a test case for #2282 --- diff --git a/tests/2282.dot b/tests/2282.dot new file mode 100644 index 000000000..d538a55e0 --- /dev/null +++ b/tests/2282.dot @@ -0,0 +1,23 @@ +digraph TicketBooking { + component=true;layout=fdp; + node [shape=box style=filled]; + cluster_reservation -> cluster_cinema; + cluster_reservation -> cluster_movie; + cluster_reservation -> cluster_user; + + subgraph cluster_cinema { + label="Cinema(Context)"; + } + + subgraph cluster_movie { + label="Movie(Context)"; + } + + subgraph cluster_reservation { + label="Reservation(Context)"; + } + + subgraph cluster_user { + label="User(Context)"; + } +} diff --git a/tests/test_regression.py b/tests/test_regression.py index 0ab5141e6..1c32fd2f3 100644 --- a/tests/test_regression.py +++ b/tests/test_regression.py @@ -1987,3 +1987,20 @@ def test_2272(): # run the test run_c(c_src, link=["cgraph", "gvc"]) + +@pytest.mark.xfail(strict=True) +def test_2282(): + """ + using the `fdp` layout with JSON output should result in valid JSON + https://gitlab.com/graphviz/graphviz/-/issues/2282 + """ + + # locate our associated test case in this directory + input = Path(__file__).parent / "2282.dot" + assert input.exists(), "unexpectedly missing test case" + + # translate this to JSON + output = dot("json", input) + + # confirm this is valid JSON + json.loads(output)