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

« back to all changes in this revision

Viewing changes to t/howbig.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
# Test datatype sizes in bytes are correct
 
2
 
 
3
use PDL::LiteF;
 
4
use PDL::Core ':Internal'; # For howbig()
 
5
 
 
6
sub ok {
 
7
        my $no = shift ;
 
8
        my $result = shift ;
 
9
        print "not " unless $result ;
 
10
        print "ok $no\n" ;
 
11
}
 
12
 
 
13
print "1..6\n";
 
14
 
 
15
ok(1, howbig(byte(42)->get_datatype)==1);
 
16
ok(2, howbig(short(42)->get_datatype)==2);
 
17
ok(3, howbig(ushort(42)->get_datatype)==2);
 
18
ok(4, howbig(long(42)->get_datatype)==4);
 
19
ok(5, howbig(float(42)->get_datatype)==4);
 
20
ok(6, howbig(double(42)->get_datatype)==8);
 
21