flexraw.t (PDL-2.080) | : | flexraw.t (PDL-2.081) | ||
---|---|---|---|---|
skipping to change at line 134 | skipping to change at line 134 | |||
undef $x; | undef $x; | |||
# Load it back up and see if the values are what we expect | # Load it back up and see if the values are what we expect | |||
$y = readflex($name); | $y = readflex($name); | |||
# **TEST 11** | # **TEST 11** | |||
ok(all(approx($y, PDL->pdl([[0,1,2],[0.1,1.1,2.1]]))), | ok(all(approx($y, PDL->pdl([[0,1,2],[0.1,1.1,2.1]]))), | |||
"mapfraw should be able to create new ndarrays"); | "mapfraw should be able to create new ndarrays"); | |||
# **TEST 12** test the created type | # **TEST 12** test the created type | |||
ok($y->type->[0] == (&float)->[0], 'type should be of the type we specified ( float)'); | ok($y->type->[0] == (&float)->[0], 'type should be of the type we specified ( float)'); | |||
undef $x; undef $y; # cleanup | ||||
# test for bug mentioned in https://perlmonks.org/?node_id=387256 | ||||
my $p1 = sequence(5); | ||||
my $header1 = eval { writeflex($cdname, $p1) }; | ||||
is $@, '', 'no error'; | ||||
writeflexhdr($cdname, $header1); | ||||
my $p2 = sequence(5) + 8; | ||||
my $header2 = eval { writeflex($name, $p2) }; | ||||
is $@, '', 'no error'; | ||||
writeflexhdr($name, $header2); | ||||
$p1 = mapflex($cdname); | ||||
is $p1.'', '[0 1 2 3 4]', 'right value before second mapflex'; | ||||
$p2 = mapflex($name); | ||||
is $p1.'', '[0 1 2 3 4]', 'still right value after second mapflex'; | ||||
is $p2.'', '[8 9 10 11 12]', 'second ndarray values right'; | ||||
undef $p1; undef $p2; | ||||
unlink $cdname, $cdname . '.hdr'; | ||||
} | } | |||
# Clean things up a bit | # Clean things up a bit | |||
unlink $name, $name . '.hdr'; | unlink $name, $name . '.hdr'; | |||
# Test the file header options: | # Test the file header options: | |||
# Tests to write still: | # Tests to write still: | |||
# Test using file handles instead of file names | # Test using file handles instead of file names | |||
# test read_flexhdr | # test read_flexhdr | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 17 lines changed or added |