Skip to content
This repository has been archived by the owner on Oct 21, 2021. It is now read-only.

Commit

Permalink
Fix depwarn in test
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyichao committed Nov 1, 2015
1 parent 04b198d commit 6b198b9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion test/dot.jl
Expand Up @@ -2,7 +2,7 @@ using Graphs
using Base.Test

function has_match(regex, str)
!isa(match(regex, str), Nothing)
match(regex, str) !== nothing
end

function xor(a, b)
Expand Down
18 changes: 10 additions & 8 deletions test/dot2.jl
@@ -1,10 +1,10 @@
# Additional tests of the to_dot function

# This adds tests where:
# This adds tests where:
# 1) there are isolated vertices
# 2) there are vertex attributes to be shown in .dot
# 3) the graph verifies implements_edge_list(.) == true
# and implements_vertex_map(.) == true
# 3) the graph verifies implements_edge_list(.) == true
# and implements_vertex_map(.) == true


# These functions help with dealing with the fact that in two equivalent
Expand All @@ -21,10 +21,12 @@
# for testing

# NOTE: if to_dot is modified to emit lines with .dot comments, these tests
# mail fail erroneously....
# mail fail erroneously....

using Compat

comRX = Base.compile(r"^[^\[]+\[([^\[]+)\]\h*$"x)
function rewriteAttrs(a::String)
function rewriteAttrs(a::AbstractString)
m = match(comRX,a)
if m!=nothing
attrs = m.captures[1]
Expand All @@ -38,7 +40,7 @@ function rewriteAttrs(a::String)
end
end

function check_same_dot(a::String,b::String)
function check_same_dot(a::AbstractString,b::AbstractString)
sa=sort( map( rewriteAttrs, split( a, "\n")))
sb=sort( map( rewriteAttrs, split( b, "\n")))
la = map(rewriteAttrs,sa)
Expand Down Expand Up @@ -97,10 +99,10 @@ using Base.Test
###########

immutable MyVtxType
name::String
name::AbstractString
end

import Graphs.attributes
import Graphs.attributes
function Graphs.attributes{G<:AbstractGraph}(vtx::MyVtxType,g::G)
rd = Graphs.AttributeDict()
rd["label"]=vtx.name
Expand Down

0 comments on commit 6b198b9

Please sign in to comment.