Skip to content

Commit dc4d8a1

Browse files
apaz-climaleadt
authored andcommitted
Fixed some tests.
1 parent ab88ba3 commit dc4d8a1

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

test/errorshow.jl

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -374,21 +374,21 @@ let err_str,
374374
j = reinterpret(EightBitTypeT{Int32}, 0x54)
375375

376376
err_str = @except_str Bool() MethodError
377-
@test occursin("MethodError: no method matching Bool()", err_str)
377+
@test occursin("MethodError: no method matching for call to Bool()", err_str)
378378
err_str = @except_str :a() MethodError
379379
@test occursin("MethodError: objects of type Symbol are not callable", err_str)
380380
err_str = @except_str EightBitType() MethodError
381-
@test occursin("MethodError: no method matching $(curmod_prefix)EightBitType()", err_str)
381+
@test occursin("MethodError: no method matching for call to $(curmod_prefix)EightBitType()", err_str)
382382
err_str = @except_str i() MethodError
383383
@test occursin("MethodError: objects of type $(curmod_prefix)EightBitType are not callable", err_str)
384384
err_str = @except_str EightBitTypeT() MethodError
385-
@test occursin("MethodError: no method matching $(curmod_prefix)EightBitTypeT()", err_str)
385+
@test occursin("MethodError: no method matching for call to $(curmod_prefix)EightBitTypeT()", err_str)
386386
err_str = @except_str EightBitTypeT{Int32}() MethodError
387-
@test occursin("MethodError: no method matching $(curmod_prefix)EightBitTypeT{Int32}()", err_str)
387+
@test occursin("MethodError: no method matching for call to $(curmod_prefix)EightBitTypeT{Int32}()", err_str)
388388
err_str = @except_str j() MethodError
389389
@test occursin("MethodError: objects of type $(curmod_prefix)EightBitTypeT{Int32} are not callable", err_str)
390390
err_str = @except_str FunctionLike()() MethodError
391-
@test occursin("MethodError: no method matching (::$(curmod_prefix)FunctionLike)()", err_str)
391+
@test occursin("MethodError: no method matching for call to (::$(curmod_prefix)FunctionLike)()", err_str)
392392
err_str = @except_str [1,2](1) MethodError
393393
@test occursin("MethodError: objects of type Vector{$Int} are not callable\nUse square brackets [] for indexing an Array.", err_str)
394394
# Issue 14940
@@ -401,10 +401,10 @@ end
401401
# Issue 34636
402402
let err_str
403403
err_str = @except_str 1 + rand(5) MethodError
404-
@test occursin("MethodError: no method matching +(::$Int, ::Vector{Float64})", err_str)
404+
@test occursin("MethodError: no method matching for call to +(::$Int, ::Vector{Float64})", err_str)
405405
@test occursin("For element-wise addition, use broadcasting with dot syntax: scalar .+ array", err_str)
406406
err_str = @except_str rand(5) - 1//3 MethodError
407-
@test occursin("MethodError: no method matching -(::Vector{Float64}, ::Rational{$Int})", err_str)
407+
@test occursin("MethodError: no method matching for call to -(::Vector{Float64}, ::Rational{$Int})", err_str)
408408
@test occursin("For element-wise subtraction, use broadcasting with dot syntax: array .- scalar", err_str)
409409
end
410410

@@ -558,7 +558,7 @@ let
558558
# one constructor defined?
559559
EnclosingModule.AbstractTypeNoConstructors(x, y) = x + y
560560
@test startswith(sprint(showerror, method_error),
561-
"MethodError: no method matching $(EnclosingModule.AbstractTypeNoConstructors)()")
561+
"MethodError: no method matching for call to $(EnclosingModule.AbstractTypeNoConstructors)()")
562562

563563
# Test that the 'default' sysimg.jl method is not displayed.
564564
@test !occursin("where T at sysimg.jl", sprint(showerror, method_error))
@@ -582,14 +582,14 @@ end
582582
e
583583
end::MethodError
584584
str = sprint(Base.showerror, ex1)
585-
@test startswith(str, "MethodError: no method matching f21006(::Tuple{})")
585+
@test startswith(str, "MethodError: no method matching for call to f21006(::Tuple{})")
586586
@test !occursin("The applicable method may be too new", str)
587587

588588
# If newer applicable methods are available, world age should be mentioned.
589589
f21006(x) = x
590590
@test f21006(()) === ()
591591
str = sprint(Base.showerror, ex1)
592-
@test startswith(str, "MethodError: no method matching f21006(::Tuple{})")
592+
@test startswith(str, "MethodError: no method matching for call to f21006(::Tuple{})")
593593
@test occursin("The applicable method may be too new: running in world age $(ex1.world)", str)
594594

595595
# This method error should be thrown in a world new enough for `f21006(())`.
@@ -600,15 +600,15 @@ end
600600
e
601601
end::MethodError
602602
str = sprint(Base.showerror, ex2)
603-
@test startswith(str, "MethodError: no method matching f21006(::Tuple{}, ::Tuple{})")
603+
@test startswith(str, "MethodError: no method matching for call to f21006(::Tuple{}, ::Tuple{})")
604604
@test !occursin("The applicable method may be too new", str)
605605

606606
# If the method is available in the exception world or if the exception world is invalid,
607607
# don't warn about world age
608608
for ex3 in (MethodError(ex1.f, ex1.args, ex2.world),
609609
MethodError(ex1.f, ex1.args, typemax(UInt)))
610610
str = sprint(Base.showerror, ex3)
611-
@test startswith(str, "MethodError: no method matching f21006(::Tuple{})")
611+
@test startswith(str, "MethodError: no method matching for call to f21006(::Tuple{})")
612612
@test !occursin("The applicable method may be too new", str)
613613
end
614614
end
@@ -627,10 +627,10 @@ end
627627
@test Base.Experimental.register_error_hint(recommend_oneunit, MethodError) === nothing
628628
let err_str
629629
err_str = @except_str one(HasNoOne()) MethodError
630-
@test occursin(r"MethodError: no method matching one\(::.*HasNoOne\)", err_str)
630+
@test occursin(r"MethodError: no method matching for call to one\(::.*HasNoOne\)", err_str)
631631
@test occursin("HasNoOne does not support `one`; did you mean `oneunit`?", err_str)
632632
err_str = @except_str one(HasNoOne(); value=2) MethodError
633-
@test occursin(Regex("MethodError: no method matching one\\(::.*HasNoOne; value::$(Int)\\)"), err_str)
633+
@test occursin(Regex("MethodError: no method matching for call to one\\(::.*HasNoOne; value::$(Int)\\)"), err_str)
634634
@test occursin("`one` doesn't take keyword arguments, that would be silly", err_str)
635635
end
636636
pop!(Base.Experimental._hint_handlers[MethodError]) # order is undefined, don't copy this
@@ -936,5 +936,5 @@ end
936936

937937
@testset "issue #47559" begin
938938
err = try; invoke(Returns, Tuple{Any,Val{N}} where N, 1, Val(1)) catch ex; ex; end
939-
@test startswith(sprint(Base.showerror, err), "MethodError: no method matching Returns(::Any, ::Val{N})")
939+
@test startswith(sprint(Base.showerror, err), "MethodError: no method matching for invoke of Returns(::Any, ::Val{N})")
940940
end

0 commit comments

Comments
 (0)