]> granicus.if.org Git - graphviz/commitdiff
add a test case for #1618
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 6 Jan 2023 05:45:23 +0000 (21:45 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 8 Jan 2023 01:56:24 +0000 (17:56 -0800)
Gitlab: #1618

tests/test_regression.py

index 1d69e9f3dd89551e1d0385cfbf611fcd099c4da0..c41b9dae536719d5ac844e384e19e4fb7ce57c74 100644 (file)
@@ -601,6 +601,27 @@ def test_1594():
   assert "line 3:" in stderr, \
     "GVPR did not identify correct line of syntax error"
 
+@pytest.mark.parametrize("long,short", (("--help", "-?"),
+                                        ("--version", "-V")))
+@pytest.mark.xfail(strict=True)
+def test_1618(long: str, short: str):
+  """
+  Graphviz should understand `--help` and `--version`
+  https://gitlab.com/graphviz/graphviz/-/issues/1618
+  """
+
+  # run Graphviz with the short form of the argument
+  p1 = subprocess.run(["dot", short], stdout=subprocess.PIPE,
+                      stderr=subprocess.PIPE, check=True)
+
+  # run it with the long form of the argument
+  p2 = subprocess.run(["dot", long], stdout=subprocess.PIPE,
+                      stderr=subprocess.PIPE, check=True)
+
+  # output from both should match
+  assert p1.stdout == p2.stdout, f"`dot {long}` wrote output than `dot {short}`"
+  assert p1.stderr == p2.stderr, f"`dot {long}` wrote output than `dot {short}`"
+
 @pytest.mark.xfail(strict=True)
 def test_1624():
   """