Skip to content
Browse files

more and better test converage for transpose()

  • Loading branch information...
1 parent 61384ec commit ba084ac8cc5fc3f108faa6881288173ccbc24732 @moritz moritz committed Sep 9, 2010
Showing with 7 additions and 2 deletions.
  1. +7 −2 t/04-transpose.t
View
9 t/04-transpose.t
@@ -2,12 +2,17 @@ use Test;
use List::Utils;
plan *;
-
-is transpose(([])), (), "empty matrix";
+nok transpose(([])).elems, "empty matrix";
is transpose(([],[])), (), "empty matrix";
is transpose(([1])), ([1]), "one element matrix";
is transpose(([1,2,3])), ([1],[2],[3]), "one line only matrix";
+is transpose(([1,2,3])).join('|'), '1|2|3', 'one line matrix (structure)';
is transpose(([1,2,3],[4,5,6])), ([1,4],[2,5],[3,6]), "simple matrix";
is transpose(([1,2,3,4,5],[6],[7,8,9],[10,11])), ([1,6,7,10],[2,8,11],[3,9],[4],[5]), "strange matrix";
+is transpose(([1,2,3,4,5],[6],[7,8,9],[10,11])).join('|'),
+ '1 6 7 10|2 8 11|3 9|4|5', "strange matrix (structure)";
+
+is transpose(([<a b c d e>],[<f>],[<g h i>],[<j k>])).join('|'),
+ 'a f g j|b h k|c i|d|e', "strange matrix with strings (structure)";
done_testing;

0 comments on commit ba084ac

Please sign in to comment.
Something went wrong with that request. Please try again.