"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "t/constructor.t" between
PDL-2.076.tar.gz and PDL-2.077.tar.gz

About: PDL (Perl Data Language) aims to turn perl into an efficient numerical language for scientific computing (similar to IDL and MatLab).

constructor.t  (PDL-2.076):constructor.t  (PDL-2.077)
skipping to change at line 196 skipping to change at line 196
$c[2][1]=pdl(5,1,1,1); $c[2][1]=pdl(5,1,1,1);
my $d = pdl(@c); my $d = pdl(@c);
############################## ##############################
# test bad values # test bad values
my $x = pdl(3,4,5); my $x = pdl(3,4,5);
$x=$x->setbadif($x==4); $x=$x->setbadif($x==4);
my $y = eval { pdl($x,5) }; my $y = eval { pdl($x,5) };
is $@, '', "a badvalue PDL works in the constructor"; is $@, '', "a badvalue PDL works in the constructor";
ok( $y->badflag, "bad value propagates from inner PDL to constructed PDL" ); ok( $y->badflag, "bad value propagates from inner PDL to constructed PDL" );
ok( $y->slice("(1),(0)") == $y->badvalue, "bad value was passed in" ); is( $y->slice("(1),(0)").'', 'BAD', "bad value was passed in" );
ok( $y->at(1,1) == 0, "padding was correct" ); ok( $y->at(1,1) == 0, "padding was correct" );
eval '$y = pdl(short, $x, 5);'; eval { $y = pdl(short, $x, 5) };
is $@, '', "constructed a short PDL"; is $@, '', "constructed a short PDL";
ok( $y->slice("(1),(0)") == $y->badvalue, "bad value was translated" ); is( $y->slice("(1),(0)").'', 'BAD', "bad value was translated" );
ok( $y->at(1,1) == 0, "padding was correct"); ok( $y->at(1,1) == 0, "padding was correct");
{ {
# Tests for a segfault bug in PDL through 2.4.2 # Tests for a segfault bug in PDL through 2.4.2
# (Thanks, Alexey!) # (Thanks, Alexey!)
my $x = pdl(1,2); my $x = pdl(1,2);
my $y = bless \my $z,"ASFG"; my $y = bless \my $z,"ASFG";
throws_ok { throws_ok {
$x != $y $x != $y
} qr/Error - tried to use an unknown/; } qr/Error - tried to use an unknown/;
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)