summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorArun Isaac2021-12-13 17:41:19 +0530
committerArun Isaac2021-12-13 18:06:04 +0530
commit64ed9fb4581b290c6c64152e577ee166ff1d4dd7 (patch)
tree5ac4f4b6e1c07844d79a64bc0d878f27b44f7086 /tests
parentb42c56555a06cdd75070fcef64587f67f09f91a9 (diff)
downloadccwl-64ed9fb4581b290c6c64152e577ee166ff1d4dd7.tar.gz
ccwl-64ed9fb4581b290c6c64152e577ee166ff1d4dd7.tar.lz
ccwl-64ed9fb4581b290c6c64152e577ee166ff1d4dd7.zip
ccwl: Escape only the double quote character in graphviz output.
* ccwl/graphviz.scm: Import (ice-9 string-fun).
(serialize): When quoting strings, escape only the double quote
character.
* tests/graphviz.scm ("do not escape backslashes"): New test case.
Diffstat (limited to 'tests')
-rw-r--r--tests/graphviz.scm13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/graphviz.scm b/tests/graphviz.scm
index 5853616..bb99edc 100644
--- a/tests/graphviz.scm
+++ b/tests/graphviz.scm
@@ -45,4 +45,17 @@
                                         `((label . ,(html-string "<table><tr><td>bar</td></tr></table>"))))))
        port))))
 
+(test-equal "do not escape backslashes"
+  "digraph foo {
+  bar [label=\"foo\\lbar\"];
+}
+"
+  (call-with-output-string
+    (lambda (port)
+      (graph->dot
+       (graph 'foo
+              #:nodes (list (graph-node 'bar
+                                        `((label . "foo\\lbar")))))
+       port))))
+
 (test-end "graphviz")