Skip to content

Commit

Permalink
Add tests for dice clump bug (sf #378)
Browse files Browse the repository at this point in the history
  • Loading branch information
devel-chm committed Sep 28, 2015
1 parent 1182538 commit 7b8cf9a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion t/slice.t
Expand Up @@ -4,7 +4,7 @@
use strict;
use Test::More;

plan tests => 89;
plan tests => 92;
;
use PDL::LiteF;

Expand Down Expand Up @@ -186,6 +186,13 @@ $a = sequence(10,4);
is($a->dice([1,2],[0,3])->sum, 66, "dice");
is($a->dice([0,1],'X')->sum, 124, "dice 'X'");

# Test of dice clump compatability
my $xxx = PDL->new([[[0,0]],[[1,1]],[[2,2]]]);
is_deeply($xxx->where($xxx == 0)->unpdl,[0,0],"dice clump base zero");
my $dice = $xxx->dice("X","X",[1,0]);
is_deeply($dice->clump(-1)->unpdl,[1,1,0,0],"dice clump correct");
is_deeply($dice->where($dice == 0)->unpdl,[0,0],"dice clump where zero");

# Test of Reorder:
$a = sequence(5,3,2);
my @newDimOrder = (2,1,0);
Expand Down

0 comments on commit 7b8cf9a

Please sign in to comment.