File: magic.t

package info (click to toggle)
pdl 2.005-4
  • links: PTS
  • area: main
  • in suites: potato
  • size: 4,200 kB
  • ctags: 3,301
  • sloc: perl: 14,876; ansic: 7,223; fortran: 3,417; makefile: 54; sh: 16
file content (58 lines) | stat: -rw-r--r-- 775 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Test the dataflow magic & binding stuff
# XXX DISABLED!

use PDL::LiteF;

kill INT,$$ if $ENV{UNDER_DEBUGGER}; # Useful for debugging.

sub ok {
	my $no = shift ;
	my $result = shift ;
	print "not " unless $result ;
	print "ok $no\n" ;
}

print "1..1\n";

ok(1,1);

if (0) {

print "1..6\n";

$ind=1;

$a = pdl 2,3,4;
$a->doflow();

$b = $a + 1;

$c = $b * 2;

@cl = (-1,-1,-1);

$c->bind(sub{ @cl = $c->list() });

ok($ind++, ((join ',',@cl) eq "-1,-1,-1"));

$a->set(0,5);

ok($ind++, ((join ',',@cl) eq "-1,-1,-1"));

$a->set(1,6);

ok($ind++, ((join ',',@cl) eq "-1,-1,-1"));

PDL::dowhenidle();

ok($ind++, ((join ',',@cl) eq "12,14,10"));

$a->set(2,7);

ok($ind++, ((join ',',@cl) eq "12,14,10"));

PDL::dowhenidle();

ok($ind++, ((join ',',@cl) eq "12,14,16"));

}