Skip to content

Commit 19f7ca1

Browse files
authored
Fix tests on recent Julia versions (#54)
1 parent c660650 commit 19f7ca1

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

test/runtests.jl

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ end
187187
@test mi mis
188188
@test length(mis) > 1
189189

190+
n = 5; str = LazyString("n is ", n); convert(String, str) # to ensure there are enough instances of `convert, (Type{String}, AbstractString)`
190191
mi = methodinstance(convert, (Type{String}, String))
191192
mis = methodinstances(methods(convert, (Type{String}, Any)))
192193
@test length(mis) > 10 # in fact, there are many more
@@ -276,17 +277,19 @@ end
276277
bes = direct_backedges(f)
277278
@test length(bes) == 1
278279
pr = bes[1]
279-
@test pr.first == Tuple{typeof(f),Any}
280+
@test pr.first === Tuple{typeof(f),Any} || pr.first === methodinstance(f, (Integer,))
280281
@test pr.second == methodinstance(applyf, (Vector{Any},))
281282

282-
bes = direct_backedges(f; skip=false)
283-
@test length(bes) == 2
284-
pr = bes[1]
285-
@test pr.first == Tuple{typeof(f),Any}
286-
@test pr.second == methodinstance(applyf, (Vector{Any},))
287-
pr = bes[2]
288-
@test pr.first == methodinstance(f, (Integer,))
289-
@test pr.second == methodinstance(applyf, (Vector{Any},))
283+
if Base.VERSION < v"1.12-DEV"
284+
bes = direct_backedges(f; skip=false)
285+
@test length(bes) == 2
286+
pr = bes[1]
287+
@test pr.first == Tuple{typeof(f), Any}
288+
@test pr.second == methodinstance(applyf, (Vector{Any},))
289+
pr = bes[2]
290+
@test pr.first == methodinstance(f, (Integer,))
291+
@test pr.second == methodinstance(applyf, (Vector{Any},))
292+
end
290293

291294
nocallers(x) = x
292295
nocallers(3)

0 commit comments

Comments
 (0)