Skip to content

Commit

Permalink
Fix for numberic labels, tested. Fixes #59.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabe Kopley committed Dec 5, 2012
1 parent 3c8c8f5 commit 7fc6632
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/graphviz/types/lbl_string.rb
Expand Up @@ -6,7 +6,7 @@ def check(data)
end end


def output def output
html = /^<([<|(^<)*<].*)>$/m.match(@data) html = /^<([<|(^<)*<].*)>$/m.match(@data.to_s)
if html != nil if html != nil
"<#{html[1]}>" "<#{html[1]}>"
else else
Expand Down
9 changes: 9 additions & 0 deletions test/test_graph.rb
Expand Up @@ -105,4 +105,13 @@ def test_search
assert_equal c1.find_node("a0"), a0 assert_equal c1.find_node("a0"), a0
assert_nil c1.search_node("a0") assert_nil c1.search_node("a0")
end 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 end

0 comments on commit 7fc6632

Please sign in to comment.