diff --git a/extra/graphviz/dot/dot-tests.factor b/extra/graphviz/dot/dot-tests.factor new file mode 100644 index 0000000000..190b9361a9 --- /dev/null +++ b/extra/graphviz/dot/dot-tests.factor @@ -0,0 +1,21 @@ +USING: graphviz.dot.private io.streams.string sequences tools.test ; +IN: graphviz.dot.tests + +! Making sure strings are escaped properly +{ + { + "\"BAH\" " + "\"LINE1\\nLINE2\" " + "\"\\lLINE1\\lLINE2\" " + "\"hum\\\"ho\\\"\" " + } +} [ + { + "BAH" + "LINE1\\nLINE2" + "\\lLINE1\\lLINE2" + "hum\"ho\"" + } [ + [ dot. ] with-string-writer + ] map +] unit-test diff --git a/extra/graphviz/dot/dot.factor b/extra/graphviz/dot/dot.factor index 82109cc87b..48677794b8 100644 --- a/extra/graphviz/dot/dot.factor +++ b/extra/graphviz/dot/dot.factor @@ -1,8 +1,8 @@ ! Copyright (C) 2012 Alex Vondrak. ! See http://factorcode.org/license.txt for BSD license. USING: accessors classes classes.tuple combinators formatting graphviz -graphviz.attributes io io.files kernel namespaces prettyprint.backend -sequences splitting strings words ; +graphviz.attributes io io.files kernel namespaces sequences splitting +strings words ; IN: graphviz.dot