diff yetilab/matrix/test/test_matrix.yeti @ 277:678477bf617c

(clumsily) make slice functions handle out-of-range arguments properly
author Chris Cannam
date Sat, 25 May 2013 18:41:53 +0100
parents 2c3faf6a2820
children 7f000ae124db
line wrap: on
line diff
--- a/yetilab/matrix/test/test_matrix.yeti	Sat May 25 18:31:10 2013 +0100
+++ b/yetilab/matrix/test/test_matrix.yeti	Sat May 25 18:41:53 2013 +0100
@@ -448,13 +448,19 @@
 "rowSlice-\(name)": \(
     compareMatrices
        (mat.rowSlice (newMatrix (RowMajor ()) [[1,0],[3,4],[0,6],[7,8]]) 1 3)
-       (newMatrix (RowMajor ()) [[3,4],[0,6]])
+       (newMatrix (RowMajor ()) [[3,4],[0,6]]) and
+        compareMatrices
+           (mat.rowSlice (newMatrix (RowMajor ()) [[1,0],[3,4],[0,6],[7,8]]) 3 6)
+           (newMatrix (RowMajor ()) [[7,8]])
 ),
 
 "columnSlice-\(name)": \(
     compareMatrices
        (mat.columnSlice (newMatrix (RowMajor ()) [[1,0,3,4],[0,6,7,8]]) 1 3)
-       (newMatrix (RowMajor ()) [[0,3],[6,7]])
+       (newMatrix (RowMajor ()) [[0,3],[6,7]]) and
+        compareMatrices
+           (mat.columnSlice (newMatrix (RowMajor ()) [[1,0,3,4],[0,6,7,8]]) 2 5)
+           (newMatrix (RowMajor ()) [[3,4],[7,8]])
 ),
 
 "density-\(name)": \(