From: Matthew Fernandez Date: Sat, 2 Jul 2022 03:17:18 +0000 (-0700) Subject: add a test case for #358 X-Git-Tag: 5.0.0~7^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dde823fcd8f586a4f7f38f069c2c6f7ef8de5d62;p=graphviz add a test case for #358 --- diff --git a/tests/358.dot b/tests/358.dot new file mode 100644 index 000000000..2f41026b5 --- /dev/null +++ b/tests/358.dot @@ -0,0 +1,14 @@ +digraph H { + xdotversion=1.7 + rankdir=LR + a [label=<Bold text>] + b [label=<Italic text>] + c [label=<Underlined text>] + d [label=<Overstrike text>] + e [label=<Subscript text>] + f [label=<Superscript text>] + g [label=<Strikethrough text>] + h [label=<Courier text>] + i [label=<fontsize 36 text>] +} + diff --git a/tests/test_regression.py b/tests/test_regression.py index 4e6ed5f57..744ccb874 100644 --- a/tests/test_regression.py +++ b/tests/test_regression.py @@ -307,6 +307,25 @@ def test_191(): assert p.returncode != 0, "syntax error was only a warning, not an error" +@pytest.mark.xfail(strict=True) +def test_358(): + """ + setting xdot version to 1.7 should enable font characteristics + https://gitlab.com/graphviz/graphviz/-/issues/358 + """ + + # locate our associated test case in this directory + input = Path(__file__).parent / "358.dot" + assert input.exists(), "unexpectedly missing test case" + + # process this with dot + xdot = dot("xdot", input) + + for i in range(6): + m = re.search(f"\\bt {1 << i}\\b", xdot) + assert m is not None, \ + f"font characteristic {1 << i} not enabled in xdot 1.7" + @pytest.mark.skipif(shutil.which("gv2gxl") is None or shutil.which("gxl2gv") is None, reason="GXL tools not available")