Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deprecations #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ If in your src file you have defined an iterator `SomeRandomNumbers`
```julia
module CountingGames
export SomeRandomNumbers
immutable SomeRandomNumbers end
struct SomeRandomNumbers end
Base.start(::SomeRandomNumbers) = 1
Base.done(::SomeRandomNumbers, state) = state>100
Base.iteratorsize(::Type{SomeRandomNumbers}) = Base.SizeUnknown()
Expand Down
12 changes: 6 additions & 6 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ using InterfaceTesting
using Base.Test
using Base.Test: Fail

type NoThrowTestSet <: Base.Test.AbstractTestSet
mutable struct NoThrowTestSet <: Base.Test.AbstractTestSet
results::Vector
NoThrowTestSet(desc) = new([])
end
Expand All @@ -21,34 +21,34 @@ function includes_failing_string(results, substring)
end


immutable BrokenJuliaZeroFourIterator end
struct BrokenJuliaZeroFourIterator end
Base.start(::BrokenJuliaZeroFourIterator) = 1
Base.next(::BrokenJuliaZeroFourIterator, state) = state+1, state+1
Base.done(::BrokenJuliaZeroFourIterator, state) = state>5

immutable BrokenHasLengthIterator end
struct BrokenHasLengthIterator end
Base.start(::BrokenHasLengthIterator) = 1
Base.next(::BrokenHasLengthIterator, state) = state+1, state+1
Base.done(::BrokenHasLengthIterator, state) = state>5
Base.iteratorsize(::Type{BrokenHasLengthIterator}) = Base.HasLength #Return the Type not the instance
Base.length(::BrokenHasLengthIterator) = 5

immutable BrokenIteratorsizeIterator end
struct BrokenIteratorsizeIterator end
Base.start(::BrokenIteratorsizeIterator) = 1
Base.next(::BrokenIteratorsizeIterator, state) = state+1, state+1
Base.done(::BrokenIteratorsizeIterator, state) = false
Base.iteratorsize(::BrokenIteratorsizeIterator) = Base.IsInfinite()
#Set iteratorsize on the instance not the type


immutable BrokenLengthIterator end
struct BrokenLengthIterator end
Base.start(::BrokenLengthIterator) = 1
Base.next(::BrokenLengthIterator, state) = state+1, state+1
Base.done(::BrokenLengthIterator, state) = state>5
Base.iteratorsize(::Type{BrokenLengthIterator}) = Base.HasLength()
#Don't define the length

immutable UnknownLengthIterator end
struct UnknownLengthIterator end
Base.start(::UnknownLengthIterator) = 1
Base.done(::UnknownLengthIterator, state) = state>100
Base.iteratorsize(::Type{UnknownLengthIterator}) = Base.SizeUnknown()
Expand Down