~ubuntu-branches/ubuntu/lucid/pdl/lucid

« back to all changes in this revision

Viewing changes to t/argtest.t

  • Committer: Bazaar Package Importer
  • Author(s): Ben Gertzfield
  • Date: 2002-04-08 18:47:16 UTC
  • Revision ID: james.westby@ubuntu.com-20020408184716-0hf64dc96kin3htp
Tags: upstream-2.3.2
ImportĀ upstreamĀ versionĀ 2.3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# tests for error checking of input args to PP compiled function
 
2
#
 
3
use PDL::LiteF;
 
4
use vars qw/$a $b/;
 
5
kill INT,$$ if $ENV{UNDER_DEBUGGER}; # Useful for debugging.
 
6
 
 
7
sub ok {
 
8
        my $no = shift ;
 
9
        my $result = shift ;
 
10
        print "not " unless $result ;
 
11
        print "ok $no\n" ;
 
12
}
 
13
 
 
14
sub tapprox {
 
15
        my($a,$b,$c,$d) = @_;
 
16
        $c = abs($a-$b);
 
17
        $d = max($c);
 
18
        return $d < 0.01;
 
19
}
 
20
 
 
21
print "1..1\n";
 
22
 
 
23
$b=pdl([1,2,3])->long;
 
24
$a=[1,2,3];
 
25
eval 'PDL::Ufunc::sumover($a,$b)';
 
26
 
 
27
print "EXPECT ERROR NEXT:\n-----\n";
 
28
print $@;
 
29
print "-----\n";
 
30
 
 
31
ok(1,$@ =~ /Error - argument is not a recognised data structure/);
 
32
 
 
33