comparison 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
comparison
equal deleted inserted replaced
9101:25cdd6096442 9102:9dc516d36175
218 %! STR.struct_fld.x == 0 && ... 218 %! STR.struct_fld.x == 0 && ...
219 %! STR.struct_fld.y == 1); 219 %! STR.struct_fld.y == 1);
220 %! 220 %!
221 %! delete struct.dat; 221 %! delete struct.dat;
222 %! 222 %!
223 %!test
224 %! matrix1 = rand(100, 2);
225 %! save -ascii matrix.ascii matrix1
226 %! matrix2 = load ("matrix.ascii");
227 %! assert (matrix1, matrix2, 1e-9)
228 %!
229 %! delete matrix.ascii;
223 230
224 %% FIXME Disable this test as it writes to stdout and there is no easy 231 %% FIXME Disable this test as it writes to stdout and there is no easy
225 %% way to recover output. Need to spawn new octave process and pipe stdout 232 %% way to recover output. Need to spawn new octave process and pipe stdout
226 %% somewhere to treat this case 233 %% somewhere to treat this case
227 %% test/octave.test/io/puts-1.m 234 %% test/octave.test/io/puts-1.m