4 use Test::More tests => 16;
5 BEGIN { use_ok('template_typedef_cplx2') }
6 require_ok('template_typedef_cplx2');
8 # adapted from ../python/template_typedef_cplx2_runme.py
10 { # kids, don't try this at home (glob hijinks)
11 my $cvar = *template_typedef_cplx2::;
12 map { ${*::}{$_} = ${$cvar}{$_} } keys %{$cvar};
19 my $d = eval { make_Identity_double() };
20 ok(ref($d), 'is an object');
21 like(ref($d), qr/ArithUnaryFunction/, "is an ArithUnaryFunction");
23 my $e = eval { make_Multiplies_double_double_double_double($d, $d) };
24 ok(ref($e), 'is an object');
25 like(ref($e), qr/ArithUnaryFunction/, "is an ArithUnaryFunction");
31 my $c = eval { make_Identity_complex() };
32 ok(ref($c), 'is an object');
33 like(ref($c), qr/ArithUnaryFunction/, "is an ArithUnaryFunction");
35 my $f = eval { make_Multiplies_complex_complex_complex_complex($c, $c) };
36 ok(ref($f), 'is an object');
37 like(ref($f), qr/ArithUnaryFunction/, "is an ArithUnaryFunction");
43 my $g = eval { make_Multiplies_double_double_complex_complex($d, $c) };
44 ok(ref($g), 'is an object');
45 like(ref($g), qr/ArithUnaryFunction/, "is an ArithUnaryFunction");
47 my $h = eval { make_Multiplies_complex_complex_double_double($c, $d) };
48 ok(ref($h), 'is an object');
49 like(ref($h), qr/ArithUnaryFunction/, "is an ArithUnaryFunction");
51 can_ok($g, 'get_value');
52 ok(eval { $g->get_value() }, 'get_value');