diff test/test_io.m @ 9102:9dc516d36175

Add a test for saving and reading a matrix with the "-ascii" format
author Carlo de Falco <carlo.defalco@gmail.com>
date Tue, 07 Apr 2009 15:17:49 +0200
parents eb63fbe60fab
children f5b51f54f44e
line wrap: on
line diff
--- a/test/test_io.m
+++ b/test/test_io.m
@@ -220,6 +220,13 @@
 %!
 %! delete struct.dat;
 %!
+%!test
+%! matrix1 = rand(100, 2);
+%! save -ascii matrix.ascii matrix1
+%! matrix2 = load ("matrix.ascii");
+%! assert (matrix1, matrix2, 1e-9)
+%!
+%! delete matrix.ascii;
 
 %% FIXME Disable this test as it writes to stdout and there is no easy
 %% way to recover output. Need to spawn new octave process and pipe stdout