Skip to content

Commit 62018cc

Browse files
author
Florian Plaza Oñate
committed
Enable unit tests with negative indices
1 parent 2eab5d8 commit 62018cc

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

inst/unitTests/runit.Matrix.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,9 @@ if (.runThisTest) {
178178
checkEquals(mat_access_with_bounds_checking(m, 3, 2), 12)
179179
checkException(mat_access_with_bounds_checking(m, 4, 2) , msg = "index out of bounds not detected" )
180180
checkException(mat_access_with_bounds_checking(m, 3, 3) , msg = "index out of bounds not detected" )
181-
#checkException(mat_access_with_bounds_checking(m, 3, -1) , msg = "index out of bounds not detected" )
182-
#checkException(mat_access_with_bounds_checking(m, -1, 2) , msg = "index out of bounds not detected" )
183-
#checkException(mat_access_with_bounds_checking(m, -1, -1) , msg = "index out of bounds not detected" )
181+
checkException(mat_access_with_bounds_checking(m, 3, -1) , msg = "index out of bounds not detected" )
182+
checkException(mat_access_with_bounds_checking(m, -1, 2) , msg = "index out of bounds not detected" )
183+
checkException(mat_access_with_bounds_checking(m, -1, -1) , msg = "index out of bounds not detected" )
184184
}
185185

186186
}

inst/unitTests/runit.Vector.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ if (.runThisTest) {
688688
x <- seq(1L, 5L, by=1L)
689689
checkEquals(vec_access_with_bounds_checking(x, 3), 4)
690690
checkException(vec_access_with_bounds_checking(x, 5) , msg = "index out of bounds not detected" )
691-
#checkException(vec_access_with_bounds_checking(x, -1) , msg = "index out of bounds not detected" )
691+
checkException(vec_access_with_bounds_checking(x, -1) , msg = "index out of bounds not detected" )
692692
}
693693
}
694694

0 commit comments

Comments
 (0)