Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix for numberic labels, tested. Fixes #59.

  • Loading branch information...
commit 7fc66326757d64d8c170977c31231d8a41ec3b7f 1 parent 3c8c8f5
@gkop gkop authored
Showing with 10 additions and 1 deletion.
  1. +1 −1  lib/graphviz/types/lbl_string.rb
  2. +9 −0 test/test_graph.rb
View
2  lib/graphviz/types/lbl_string.rb
@@ -6,7 +6,7 @@ def check(data)
end
def output
- html = /^<([<|(^<)*<].*)>$/m.match(@data)
+ html = /^<([<|(^<)*<].*)>$/m.match(@data.to_s)
if html != nil
"<#{html[1]}>"
else
View
9 test/test_graph.rb
@@ -105,4 +105,13 @@ def test_search
assert_equal c1.find_node("a0"), a0
assert_nil c1.search_node("a0")
end
+
+ def test_to_s
+ assert_nothing_raised 'to_s with edge with numeric label failed.' do
+ a = @graph.add_nodes('a')
+ b = @graph.add_nodes('b')
+ @graph.add_edges(a, b, label: 5)
+ @graph.to_s
+ end
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.