From: Matthew Fernandez Date: Fri, 6 Jan 2023 05:45:23 +0000 (-0800) Subject: add a test case for #1618 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=74238e979cecadf64e67c6f5bb822eae88278de0;p=graphviz add a test case for #1618 Gitlab: #1618 --- diff --git a/tests/test_regression.py b/tests/test_regression.py index 1d69e9f3d..c41b9dae5 100644 --- a/tests/test_regression.py +++ b/tests/test_regression.py @@ -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(): """