diff yetilab/matrix/test/test_matrix.yeti @ 178:032c4986b6b0

Implement and test matrix concat
author Chris Cannam
date Thu, 02 May 2013 21:58:58 +0100
parents 370d9350495c
children fd16551c2fc8
line wrap: on
line diff
--- a/yetilab/matrix/test/test_matrix.yeti	Thu May 02 21:05:10 2013 +0100
+++ b/yetilab/matrix/test/test_matrix.yeti	Thu May 02 21:58:58 2013 +0100
@@ -278,7 +278,7 @@
         [[1,4],[2,5],[3,6]];
 ),
 
-"concat-lr-\(name)": \(
+"concat-horiz-\(name)": \(
     compareMatrices
        (mat.concat (Horizontal ()) 
           [(newMatrix (ColumnMajor ()) [[1,4],[2,5]]),
@@ -286,6 +286,36 @@
        (newMatrix (ColumnMajor ()) [[1,4],[2,5],[3,6]])
 ),
 
+"concatFail-horiz-\(name)": \(
+    try
+        \() (mat.concat (Horizontal ()) 
+          [(newMatrix (ColumnMajor ()) [[1,4],[2,5]]),
+           (newMatrix (ColumnMajor ()) [[3],[6]])]);
+        false
+    catch FailureException e:
+        true
+    yrt
+),
+
+"concat-vert-\(name)": \(
+    compareMatrices
+       (mat.concat (Vertical ()) 
+          [(newMatrix (ColumnMajor ()) [[1,4],[2,5]]),
+           (newMatrix (RowMajor ()) [[3,6]])])
+       (newMatrix (ColumnMajor ()) [[1,4,3],[2,5,6]])
+),
+
+"concatFail-vert-\(name)": \(
+    try
+        \() (mat.concat (Vertical ()) 
+          [(newMatrix (ColumnMajor ()) [[1,4],[2,5]]),
+           (newMatrix (RowMajor ()) [[3],[6]])]);
+        false
+    catch FailureException e:
+        true
+    yrt
+),
+
 ]);
 
 colhash = makeTests "column-major" id;