From 3bd1c8014ba2318384d21db48455d8ebb01a6ef3 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Mon, 26 Sep 2022 19:43:19 -0700 Subject: [PATCH] add a test case for #2282 --- tests/2282.dot | 23 +++++++++++++++++++++++ tests/test_regression.py | 17 +++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 tests/2282.dot 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) -- 2.40.0