core.t (PDL-2.078) | : | core.t (PDL-2.079) | ||
---|---|---|---|---|
skipping to change at line 470 | skipping to change at line 470 | |||
{ typefunc => *long , size => 4 }, | { typefunc => *long , size => 4 }, | |||
{ typefunc => *float , size => 4 }, | { typefunc => *float , size => 4 }, | |||
{ typefunc => *double, size => 8 }, | { typefunc => *double, size => 8 }, | |||
); | ); | |||
for my $type (@types) { | for my $type (@types) { | |||
my $pdl = $type->{typefunc}(42); # build a PDL with datatype $type->{type } | my $pdl = $type->{typefunc}(42); # build a PDL with datatype $type->{type } | |||
is( PDL::Core::howbig( $pdl->get_datatype ), $type->{size} ); | is( PDL::Core::howbig( $pdl->get_datatype ), $type->{size} ); | |||
} | } | |||
} | } | |||
for (['ones', 1], ['zeroes', 0], ['nan', 'NaN'], ['inf', 'Inf'], ['i', 'i', 'cdo uble']) { | for (['ones', 1], ['zeroes', 0], ['nan', '.*NaN'], ['inf', '.*Inf'], ['i', 'i', 'cdouble']) { | |||
my ($name, $val, $type) = @$_; | my ($name, $val, $type) = @$_; | |||
no strict 'refs'; | no strict 'refs'; | |||
my $g = eval { $name->() }; | my $g = eval { $name->() }; | |||
is $@, '', "$name works with no args"; | is $@, '', "$name works with no args"; | |||
is_deeply [$g->dims], [], 'no args -> no dims'; | is_deeply [$g->dims], [], 'no args -> no dims'; | |||
ok !$g->isnull, 'no args -> not null'; | ok !$g->isnull, 'no args -> not null'; | |||
ok !$g->isempty, 'no args -> not empty'; | ok !$g->isempty, 'no args -> not empty'; | |||
like $g.'', qr/^$val/i, "$name() gives back right value"; | like $g.'', qr/^$val/i, "$name() gives back right value"; | |||
my $g1 = eval { $name->(2) }; | my $g1 = eval { $name->(2) }; | |||
is $@, '', "$name works with 1 args"; | is $@, '', "$name works with 1 args"; | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added |