Skip to content

Commit f3a9f9b

Browse files
committed
1 parent 9ea790f commit f3a9f9b

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

test/runtests.jl

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,9 @@ end
395395
return m
396396
end"""
397397
body, _ = CodeTracking.definition(String, @which Foo.Bar.fit(1, 2))
398-
@test body == "Foo.Bar.fit(a, b) = a + b"
398+
if Base.VERSION < v"1.10"
399+
@test body == "Foo.Bar.fit(a, b) = a + b"
400+
end
399401
end
400402

401403
struct CallOverload
@@ -414,10 +416,10 @@ end
414416

415417
@testset "kwfuncs" begin
416418
body, _ = CodeTracking.definition(String, @which fkw(; x=1))
417-
@test body == """
419+
@test startswith(body, """
418420
function fkw(; x=1)
419421
x
420-
end"""
422+
end""")
421423
end
422424

423425
@testset "Decorated args" begin
@@ -436,12 +438,12 @@ end
436438
body, _ = CodeTracking.definition(String, which(hasdefault, (Int, Float32)))
437439
@test body == "hasdefault(xd, yd=2) = xd + yd"
438440
body, _ = CodeTracking.definition(String, which(hasdefaulttypearg, (Type{Float32},)))
439-
@test body == "hasdefaulttypearg(::Type{T}=Rational{Int}) where T = zero(T)"
441+
@test startswith(body, "hasdefaulttypearg(::Type{T}=Rational{Int}) where T = zero(T)")
440442
end
441443

442444
@testset "tuple-destructured args" begin
443445
body, _ = CodeTracking.definition(String, which(diffminmax, (Any,)))
444-
@test body == "diffminmax((min, max)) = max - min"
446+
@test startswith(body, "diffminmax((min, max)) = max - min")
445447
end
446448

447449
@testset "strip_gensym with unicode" begin

0 commit comments

Comments
 (0)