]> granicus.if.org Git - graphviz/commitdiff
add a test case for #797
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 31 Mar 2021 04:18:54 +0000 (21:18 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Tue, 6 Apr 2021 14:53:43 +0000 (07:53 -0700)
rtest/test_regression.py

index 572e7933d98389187e2b0d9a7446c84d36f699f3..e62b99aa8f8c289471172459c58a38ba0a6b7842 100644 (file)
@@ -217,6 +217,28 @@ def test_793():
     # Graphviz should not have caused a segfault
     assert p.returncode != -signal.SIGSEGV, 'Graphviz segfaulted'
 
+@pytest.mark.xfail(strict=True)
+def test_797():
+    '''
+    “&;” should not be considered an XML escape sequence
+    https://gitlab.com/graphviz/graphviz/-/issues/797
+    '''
+
+    # some input containing the invalid escape
+    input = 'digraph tree {\n' \
+            '"1" [shape="box", label="&amp; &amp;;", URL="a"];\n' \
+            '}'
+
+    # process this with the client-side imagemap back end
+    p = subprocess.Popen(['dot', '-Tcmapx'], stdin=subprocess.PIPE,
+      stdout=subprocess.PIPE, universal_newlines=True)
+    output, _ = p.communicate(input)
+
+    assert p.returncode == 0
+
+    # the escape sequences should have been preserved
+    assert '&amp; &amp;' in output
+
 def test_1221():
     '''
     assigning a node to two clusters with newrank should not cause a crash