Skip to content

Commit

Permalink
replace random test with set cases, flat->squeeze as fails on empty
Browse files Browse the repository at this point in the history
  • Loading branch information
mohawk2 committed Jan 31, 2024
1 parent ae3a176 commit 86f04b0
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions t/primitive-selector.t
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,16 @@ subtest 'where' => sub {
};

subtest 'vs where' => sub {
my $x = sequence( 4, 3, 2 );
my $y = ( random($x) < 0.3 );
my $c = whereND( $x, $y );
my $where = where( $x, $y );
ok tapprox( $c->squeeze, $where ), "vs where" or diag "x=$x\ny=$y\nwhere=$where\nc=$c";
my $x = sequence( 2, 2, 2 );
for my $y (
pdl('[[[0 0][0 0]][[0 0][0 0]]]'),
pdl('[[[0 0][0 0]][[0 0][0 1]]]'),
pdl('[[[0 0][0 0]][[0 1][0 1]]]'),
) {
my $c = whereND( $x, $y );
my $where = where( $x, $y );
ok tapprox( $c->flat, $where ), "vs where" or diag "x=$x\ny=$y\nwhere=$where\nc=$c";
}
};

subtest 'lvalue' => sub {
Expand Down

0 comments on commit 86f04b0

Please sign in to comment.