test/test_graph.rb in graph-2.0.1 vs test/test_graph.rb in graph-2.1.0
- old
+ new
@@ -80,10 +80,16 @@
graph.label "blah"
assert_graph graph, 'label = "blah"', '"a" -> "b"'
end
+ def test_label_newline
+ graph.label "blah\nblah"
+
+ assert_graph graph, 'label = "blah\\nblah"', '"a" -> "b"'
+ end
+
def test_left_shift
subgraph = Graph.new "blah"
graph << subgraph
@@ -281,10 +287,16 @@
n.label "blah"
assert_equal ["label = \"blah\""], n.attributes
end
+ def test_label_newline
+ n.label "blah\nblah"
+
+ assert_equal ["label = \"blah\\nblah\""], n.attributes
+ end
+
def test_to_s
assert_equal '"n"', n.to_s
end
def test_to_s_attribs
@@ -305,9 +317,15 @@
def test_label
e.label "blah"
assert_equal ["label = \"blah\""], e.attributes
+ end
+
+ def test_label_newline
+ e.label "blah\nblah"
+
+ assert_equal ["label = \"blah\\nblah\""], e.attributes
end
def test_to_s
assert_equal '"a" -> "b"', e.to_s
end