Skip to content

Commit fabe509

Browse files
committed
fix tests
1 parent 222f61a commit fabe509

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

Compiler/test/inference.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3509,11 +3509,11 @@ end
35093509
struct MixedKeyDict{T<:Tuple} #<: AbstractDict{Any,Any}
35103510
dicts::T
35113511
end
3512-
Base.merge(f::Function, d::MixedKeyDict, others::MixedKeyDict...) = _merge(f, (), d.dicts, (d->d.dicts).(others)...)
3513-
Base.merge(f, d::MixedKeyDict, others::MixedKeyDict...) = _merge(f, (), d.dicts, (d->d.dicts).(others)...)
3512+
Base.mergewith(f::Function, d::MixedKeyDict, others::MixedKeyDict...) = _merge(f, (), d.dicts, (d->d.dicts).(others)...)
3513+
Base.mergewith(f, d::MixedKeyDict, others::MixedKeyDict...) = _merge(f, (), d.dicts, (d->d.dicts).(others)...)
35143514
function _merge(f, res, d, others...)
35153515
ofsametype, remaining = _alloftype(Base.heads(d), ((),), others...)
3516-
return _merge(f, (res..., merge(f, ofsametype...)), Base.tail(d), remaining...)
3516+
return _merge(f, (res..., mergewith(f, ofsametype...)), Base.tail(d), remaining...)
35173517
end
35183518
_merge(f, res, ::Tuple{}, others...) = _merge(f, res, others...)
35193519
_merge(f, res, d) = MixedKeyDict((res..., d...))
@@ -3537,9 +3537,9 @@ _alloftype(ofdesiredtype, accumulated) = ofdesiredtype, Base.front(accumulated)
35373537
let
35383538
d = MixedKeyDict((Dict(1 => 3), Dict(4. => 2)))
35393539
e = MixedKeyDict((Dict(1 => 7), Dict(5. => 9)))
3540-
@test merge(+, d, e).dicts == (Dict(1 => 10), Dict(4.0 => 2, 5.0 => 9))
3540+
@test mergewith(+, d, e).dicts == (Dict(1 => 10), Dict(4.0 => 2, 5.0 => 9))
35413541
f = MixedKeyDict((Dict(2 => 7), Dict(5. => 11)))
3542-
@test merge(+, d, e, f).dicts == (Dict(1 => 10, 2 => 7), Dict(4.0 => 2, 5.0 => 20))
3542+
@test mergewith(+, d, e, f).dicts == (Dict(1 => 10, 2 => 7), Dict(4.0 => 2, 5.0 => 20))
35433543
end
35443544

35453545
# Issue #31974

test/dict.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1289,8 +1289,6 @@ struct NonFunctionCallable end
12891289
@test @inferred mergewith(NonFunctionCallable(), d1, d2) == Dict("A" => 1, "B" => 5, "C" => 4)
12901290
@test foldl(mergewith(+), [d1, d2]; init=Dict{Union{},Union{}}()) ==
12911291
Dict("A" => 1, "B" => 5, "C" => 4)
1292-
# backward compatibility
1293-
@test @inferred merge(+, d1, d2) == Dict("A" => 1, "B" => 5, "C" => 4)
12941292
end
12951293

12961294
@testset "Dict merge!" begin

0 commit comments

Comments
 (0)