Skip to content

Commit 8976bfa

Browse files
committed
Add test for subscripting the last element
1 parent 1510bc0 commit 8976bfa

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/test_subscript.f90

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ program test_subscript
1010
integer :: n, ntests
1111

1212
n = 1
13-
ntests = 11
13+
ntests = 12
1414
call initialize_tests(tests, ntests)
1515

1616
tests(n) = assert(all(subscript([1_int8, 2_int8, 3_int8], [2_int8]) == [2_int8]), &
@@ -45,6 +45,10 @@ program test_subscript
4545
'subscript out of bounds returns empty array')
4646
n = n + 1
4747

48+
tests(n) = assert(all(subscript([1, 2, 3], [3]) == [3]), &
49+
'subscript of last element')
50+
n = n + 1
51+
4852
tests(n) = assert(all(subscript(arange(cmplx(1._real32, 0._real32), &
4953
cmplx(3._real32, 0._real32)), [2])&
5054
== [cmplx(2._real32, 0._real32)]), &

0 commit comments

Comments
 (0)