Skip to content

Commit

Permalink
solve compile error
Browse files Browse the repository at this point in the history
  • Loading branch information
rfourquet committed Jun 11, 2017
1 parent 078f253 commit 2ab612e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 deletions.
16 changes: 16 additions & 0 deletions base/test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ test set that throws on the first failure. Users can choose to wrap
their tests in (possibly nested) test sets that will store results
and summarize them at the end of the test set with `@testset`.
"""
:Test # cf. #22288

module Test

export @test, @test_throws, @test_broken, @test_skip, @test_warn, @test_nowarn
Expand Down Expand Up @@ -1200,6 +1202,20 @@ struct GenericDict{K,V} <: Associative{K,V}
s::Associative{K,V}
end

for (G, A) in ((GenericSet, AbstractSet),
(GenericDict, Associative))
@eval begin
Base.convert(::Type{$G}, s::$A) = $G(s)
Base.done(s::$G, state) = done(s.s, state)
Base.next(s::$G, state) = next(s.s, state)
end
for f in (:eltype, :isempty, :length, :start)
@eval begin
Base.$f(s::$G) = $f(s.s)
end
end
end

Base.get(s::GenericDict, x, y) = get(s.s, x, y)

end # module
17 changes: 0 additions & 17 deletions test/random.jl
Original file line number Diff line number Diff line change
@@ -1,22 +1,5 @@
# This file is a part of Julia. License is MIT: https://julialang.org/license

# should be in base/test.jl, but does not compile...

for (G, A) in ((GenericSet, AbstractSet),
(GenericDict, Associative))
@eval begin
Base.convert(::Type{$G}, s::$A) = $G(s)
Base.done(s::$G, state) = done(s.s, state)
Base.next(s::$G, state) = next(s.s, state)
end
for f in (:eltype, :isempty, :length, :start)
@eval begin
Base.$f(s::$G) = $f(s.s)
end
end
end


# Issue #6573
srand(0); rand(); x = rand(384)
@test find(x .== rand()) == []
Expand Down

0 comments on commit 2ab612e

Please sign in to comment.