fastraw.t (PDL-2.076) | : | fastraw.t (PDL-2.077) | ||
---|---|---|---|---|
skipping to change at line 37 | skipping to change at line 37 | |||
ok((-f $name and -f ($name_hdr)), "Writing should create a file and header file" ); | ok((-f $name and -f ($name_hdr)), "Writing should create a file and header file" ); | |||
# read it back, and make sure it gives the same ndarray | # read it back, and make sure it gives the same ndarray | |||
my $y = readfraw($name); | my $y = readfraw($name); | |||
ok(tapprox($x,$y), "A ndarray and its saved copy should be about equal"); | ok(tapprox($x,$y), "A ndarray and its saved copy should be about equal"); | |||
# Clean things up a bit | # Clean things up a bit | |||
undef $x; undef $y; | undef $x; undef $y; | |||
cleanfiles(); | cleanfiles(); | |||
# save an ndarray to disk | ||||
$x = startdata(); | ||||
writefraw($x,"$name.g"); | ||||
my $x1 = pdl [10,11]; | ||||
gluefraw($x1,"$name.g"); | ||||
$y = readfraw("$name.g"); | ||||
ok(tapprox($y, pdl([2,3],[4,5],[6,7],[10,11])), "glued data correct") | ||||
or diag "got:$y"; | ||||
unlink "$name.g", "$name.g.hdr"; | ||||
# Clean things up a bit | ||||
undef $x; undef $y; | ||||
# test the use of a custom header for writing | # test the use of a custom header for writing | |||
$x = startdata(); | $x = startdata(); | |||
writefraw($x,$name,{Header => $header}); | writefraw($x,$name,{Header => $header}); | |||
ok -f $header, "writefraw should create the special header file when specified"; | ok -f $header, "writefraw should create the special header file when specified"; | |||
# test the use of a custom header for reading | # test the use of a custom header for reading | |||
$y = readfraw($name,{Header => $header}); | $y = readfraw($name,{Header => $header}); | |||
ok tapprox($x,$y), "Should be able to read given a specified header"; | ok tapprox($x,$y), "Should be able to read given a specified header"; | |||
# some mapfraw tests | # some mapfraw tests | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 12 lines changed or added |