Skip to content

Commit 3bdaf1e

Browse files
committed
Tests for views with no indices
1 parent e41fce4 commit 3bdaf1e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/test_blockviews.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ bview(a, b) = Base.invoke(view, Tuple{AbstractArray,Any}, a, b)
2626
view(A, Block(2))[2] = -1
2727
@test A[3] == -1
2828

29+
@test_throws BoundsError view(A)
30+
2931
# backend tests
3032
@test_throws ArgumentError Base.to_index(A, Block(1))
3133

@@ -46,6 +48,8 @@ bview(a, b) = Base.invoke(view, Tuple{AbstractArray,Any}, a, b)
4648
@test A[Block(4)] == A[Block(1),Block(2)]
4749
@test_throws BoundsError A[Block(10)]
4850

51+
@test_throws BoundsError view(A)
52+
4953
V = view(A, Block(3, 2))
5054
@test size(V) == (3, 4)
5155
V[2,1] = -2

0 commit comments

Comments
 (0)