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

« back to all changes in this revision

Viewing changes to t/inlinepdlpp.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
use strict;
 
2
use Test;
 
3
use blib;  # otherwise possible error on virgin systems not finding PDL::Core
 
4
 
 
5
use PDL::LiteF;
 
6
 
 
7
BEGIN {
 
8
    eval 'use Inline 0.43';
 
9
    unless ($@) {
 
10
        plan tests => 3;
 
11
    } else {
 
12
        plan tests => 1;
 
13
        print "ok 1 # Skipped: Inline not installed\n";
 
14
        exit;
 
15
    }
 
16
}
 
17
 
 
18
sub shape { join ',', $_[0]->dims }
 
19
 
 
20
use Inline 'Pdlpp';
 
21
 
 
22
ok(1); # ok, we made it so far
 
23
 
 
24
$a = sequence(3,3);
 
25
 
 
26
$b = $a->testinc;
 
27
 
 
28
ok(shape($a) eq shape($b));
 
29
 
 
30
ok(all $b == $a+1);
 
31
 
 
32
__DATA__
 
33
 
 
34
__Pdlpp__
 
35
 
 
36
# simple PP definition
 
37
 
 
38
pp_def('testinc',
 
39
        Pars => 'a(); [o] b()',
 
40
        Code => '$b() = $a() + 1;' # wow, that's complicated
 
41
);