]> granicus.if.org Git - graphviz/commitdiff
add a test case for #2282
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Tue, 27 Sep 2022 02:43:19 +0000 (19:43 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Tue, 27 Sep 2022 14:55:19 +0000 (07:55 -0700)
tests/2282.dot [new file with mode: 0644]
tests/test_regression.py

diff --git a/tests/2282.dot b/tests/2282.dot
new file mode 100644 (file)
index 0000000..d538a55
--- /dev/null
@@ -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)";
+  }
+} 
index 0ab5141e67a1326e03cabedeed67915455663b1e..1c32fd2f3059fd3ca0e10b5ad9f9512b142eb694 100644 (file)
@@ -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)