Skip to content

Commit

Permalink
change findall(occursin(... to findall(in(...
Browse files Browse the repository at this point in the history
  • Loading branch information
antimon2 committed Mar 26, 2018
1 parent 9c43de8 commit bce0dc3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/ranges.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ let T=QDates.QDate
@test_throws ArgumentError minimum(dr)
@test_throws ArgumentError maximum(dr)
@test_throws BoundsError dr[1]
@test findall(occursin(dr),dr) == Int64[]
@test findall(in(dr),dr) == Int64[]
@test [dr;] == T[]
@test isempty(reverse(dr))
@test length(reverse(dr)) == 0
Expand Down Expand Up @@ -50,7 +50,7 @@ let T=QDates.QDate
if len < 10000
dr1 = [i for i in dr]
@test length(dr1) == len
@test findall(occursin(dr),dr) == [1:len;]
@test findall(in(dr),dr) == [1:len;]
@test length([dr;]) == len
end
@test !isempty(reverse(dr))
Expand All @@ -73,7 +73,7 @@ let T=QDates.QDate
@test_throws ArgumentError minimum(dr)
@test_throws ArgumentError maximum(dr)
@test_throws BoundsError dr[1]
@test findall(occursin(dr),dr) == Int64[]
@test findall(in(dr),dr) == Int64[]
@test [dr;] == T[]
@test isempty(reverse(dr))
@test length(reverse(dr)) == 0
Expand Down Expand Up @@ -104,7 +104,7 @@ let T=QDates.QDate
if len < 10000
dr1 = [i for i in dr]
@test length(dr1) == len
@test findall(occursin(dr),dr) == [1:len;]
@test findall(in(dr),dr) == [1:len;]
@test length([dr;]) == len
end
@test !isempty(reverse(dr))
Expand Down Expand Up @@ -138,7 +138,7 @@ drs = Any[dr,dr1,dr2,dr3,dr4,dr9,dr10,
dr12,dr13,dr15,dr16,dr20]

@test map(length,drs) == map(x->size(x)[1],drs)
@test all(x->findall(occursin(x),x) == [1:length(x);], drs[1:4])
@test all(x->findall(in(x),x) == [1:length(x);], drs[1:4])
@test isempty(dr2)
@test all(x->reverse(x) == last(x):-step(x):first(x),drs)
@test all(x->minimum(x) == (step(x) < zero(step(x)) ? last(x) : first(x)),drs[4:end])
Expand Down

0 comments on commit bce0dc3

Please sign in to comment.