~ubuntu-branches/ubuntu/trusty/pdl/trusty-proposed

« back to all changes in this revision

Viewing changes to t/primitive.t

  • Committer: Bazaar Package Importer
  • Author(s): Stephan Hermann
  • Date: 2005-10-09 21:25:50 UTC
  • mfrom: (2.1.1 sarge)
  • Revision ID: james.westby@ubuntu.com-20051009212550-5uri1xdwwpswy3zu
Tags: 1:2.4.2-3ubuntu1
debian/control: added libgl1-mesa-dev and libglu1-mesa-dev to build deps
(GL/GLU Transition)

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
use strict;
13
13
use Test;
14
14
 
15
 
plan tests => 19;
 
15
plan tests => $PDL::Bad::Status ? 24 : 21 ;
16
16
 
17
17
sub tapprox {
18
18
    my($a,$b) = @_;
112
112
ok(isempty $a);
113
113
ok($b->avg == 0);
114
114
ok(! any isfinite $c->average);
 
115
 
 
116
##############################
 
117
# Test uniqvec...
 
118
$a = pdl([[0,1],[2,2],[0,1]]);
 
119
$b = $a->uniqvec;
 
120
eval '$c = all($b==pdl([[0,1],[2,2]]))';  ok(!$@ && $c);
 
121
 
 
122
$a = pdl([[0,1]])->uniqvec;
 
123
eval '$c = all($a==pdl([[0,1]]))';  ok(!$@ && $c);
 
124
 
 
125
##############################
 
126
# Test bad handling in selector
 
127
if($PDL::Bad::Status) {
 
128
  $b = xvals(3);
 
129
  ok(tapprox($b->which,PDL->pdl(1,2)));
 
130
  setbadat $b, 1;
 
131
  ok(tapprox($b->which,PDL->pdl([2])));
 
132
  setbadat $b, 0;
 
133
  setbadat $b, 2;
 
134
  ok($b->which->nelem,0);
 
135
}