]> granicus.if.org Git - graphviz/commitdiff
fix typo in clustg
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Tue, 4 Aug 2020 00:57:15 +0000 (17:57 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 9 Aug 2020 15:26:48 +0000 (08:26 -0700)
Fixes #1781.

CHANGELOG.md
cmd/gvpr/lib/clustg
rtest/test_examples.py

index 4257dac46e56c8a1639675504147c0f558c4dbcf..bd176a26e6326e3f4984db34b246b984b22f3d32 100644 (file)
@@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 - Cast Overflow at pango_textlayout #1314
 - x11 back end segfaults if display is unavailable #1776
 - Repeated file read gives different results with libcgraph #1767
+- typo in cmd/gvpr/lib/clustg #1781
 
 ## [2.44.1] - 2020-06-29
 
index 0ff8b2486876f1cb250babc313dd722807b6e385..c7294c8c0dd356a968792b1427186f6959c6ec4d 100644 (file)
@@ -35,7 +35,7 @@ BEG_G{
   setDflt(dg,"E","_cnt","0");
   setDflt(dg,"N","_cnt","0");
   proc($,NULL);
-  $tv_type = TV_ne;
+  $tvtype = TV_ne;
 }
 N[!nmap[$]]{
   dn = node(dg, name);
index dc979d086044bb2beb246c9c30a193e45eef595d..5fccc5306efad59049a1cbc371845c3d67e938c4 100644 (file)
@@ -67,3 +67,28 @@ def test_gvpr_example(src):
     # run GVPR with the given script
     with open(os.devnull, 'rt') as nul:
       subprocess.check_call(['gvpr', '-f', path], stdin=nul)
+
+@pytest.mark.skipif(shutil.which('gvpr') is None, reason='GVPR not available')
+def test_gvpr_clustg():
+    '''check cmd/gvpr/lib/clustg works'''
+
+    # construct an absolute path to clustg
+    path = os.path.join(os.path.abspath(os.path.dirname(__file__)),
+      '../cmd/gvpr/lib/clustg')
+
+    # some sample input
+    input = 'digraph { N1; N2; N1 -> N2; N3; }'
+
+    # run GVPR on this input
+    p = subprocess.Popen(['gvpr', '-f', path], stdin=subprocess.PIPE,
+      stdout=subprocess.PIPE, universal_newlines=True)
+    output, _ = p.communicate(input)
+
+    assert p.returncode == 0, 'GVPR exited with non-zero status'
+
+    assert output.strip() == 'strict digraph "clust%1" {\n' \
+                             '\tnode [_cnt=0];\n' \
+                             '\tedge [_cnt=0];\n' \
+                             '\tN1 -> N2\t[_cnt=1];\n' \
+                             '\tN3;\n' \
+                             '}', 'unexpected output'