Skip to content

Commit

Permalink
Fix v1.2 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Tokazama committed Mar 21, 2020
1 parent bcaa74e commit 746c3f3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/findfirst_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@
for f in (<, >, <=, >=, ==)
@testset "Comparison: $f" begin
@testset "findfirst($f($i1), $b)" begin
@test @inferred(typed_findfirst(f(i1), m)) == @inferred(typed_findfirst(f(i1), b))
@test @inferred(typed_findfirst(f(i1), s)) == @inferred(typed_findfirst(f(i1), b))
@test @inferred(typed_findfirst(f(i1), m)) == @inferred(catch_nothing(find_first(f(i1), b)))
@test @inferred(typed_findfirst(f(i1), s)) == @inferred(catch_nothing(find_first(f(i1), b)))
end
@testset "findfirst($f($i2), $b)" begin
@test @inferred(typed_findfirst(f(i2), m)) == @inferred(typed_findfirst(f(i2), b))
@test @inferred(typed_findfirst(f(i2), s)) == @inferred(typed_findfirst(f(i2), b))
@test @inferred(typed_findfirst(f(i2), m)) == @inferred(catch_nothing(find_first(f(i2), b)))
@test @inferred(typed_findfirst(f(i2), s)) == @inferred(catch_nothing(find_first(f(i2), b)))
end
end
end
Expand All @@ -57,10 +57,10 @@
@testset "Number: $i" begin
for f in (<, >, <=, >=, ==)
@testset "findfirst($f($i), $m" begin
@test @inferred(typed_findfirst(f(i), m)) == @inferred(typed_findfirst(f(i), b))
@test @inferred(typed_findfirst(f(i), m)) == @inferred(catch_nothing(find_first(f(i), b)))
end
@testset "findfirst($f($i), $s" begin
@test @inferred(typed_findfirst(f(i), s)) == @inferred(typed_findfirst(f(i), b))
@test @inferred(typed_findfirst(f(i), s)) == @inferred(catch_nothing(find_first(f(i), b)))
end
end
end
Expand Down
4 changes: 4 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ using StaticRanges: ArrayInterface.ismutable
using Base: OneTo, step_hp
using Base.Order

catch_nothing(x) = x
catch_nothing(x::Nothing) = 0


#=
When using ranges find_all will produce either an AbstractUnitRange or GapRange.
Therefore, in order test type stability at this level we just ensure it only ever
Expand Down

2 comments on commit 746c3f3

@Tokazama
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/11316

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if Julia TagBot is installed, or can be done manually through the github interface, or via:

git tag -a v0.5.9 -m "<description of version>" 746c3f324c082a8a90d9fd3cc67238a1905e5b63
git push origin v0.5.9

Please sign in to comment.