Skip to content

Commit

Permalink
test: eachindex for arbitrary number of arguments (#51941)
Browse files Browse the repository at this point in the history
added test cases for `eachindex` to cover arbitrary number of arguments

![image](https://github.com/JuliaLang/julia/assets/49565677/fa39cb8c-2523-40c0-90f3-e3f90f54397e)
  • Loading branch information
PraneethJain committed Nov 2, 2023
1 parent 7c74274 commit ad86772
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/arrayops.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2128,6 +2128,8 @@ R = CartesianIndices((3,0))
@test @inferred(eachindex(Base.IndexLinear(), a, b)) == 1:4
@test @inferred(eachindex(a, b)) == CartesianIndices((2,2))
@test @inferred(eachindex(a, a)) == 1:4
@test @inferred(eachindex(a, a, a)) == 1:4
@test @inferred(eachindex(a, a, b)) == CartesianIndices((2,2))
@test_throws DimensionMismatch eachindex(a, rand(3,3))
@test_throws DimensionMismatch eachindex(b, rand(3,3))
end
Expand Down

0 comments on commit ad86772

Please sign in to comment.