PageRenderTime 30ms CodeModel.GetById 1ms app.highlight 23ms RepoModel.GetById 1ms app.codeStats 1ms

/trunk/Examples/test-suite/perl5/template_typedef_cplx_runme.pl

#
Perl | 49 lines | 27 code | 11 blank | 11 comment | 0 complexity | ba05c8d5b7b8d5a2f215ed8a14618276 MD5 | raw file
 1#!/usr/bin/perl
 2use strict;
 3use warnings;
 4use Test::More tests => 14;
 5BEGIN { use_ok('template_typedef_cplx') }
 6require_ok('template_typedef_cplx');
 7
 8# adapted from ../python/template_typedef_cplx_runme.py
 9
10{	# kids, don't try this at home (glob hijinks)
11	my $cvar = *template_typedef_cplx::;
12	map { ${*::}{$_} = ${$cvar}{$_} } keys %{$cvar};
13}
14
15#
16# double case
17#
18
19my $d = eval { make_Identity_double() };
20ok(ref($d), 'is an object');
21like(ref($d), qr/ArithUnaryFunction/, "is an ArithUnaryFunction");
22
23my $e = eval { make_Multiplies_double_double_double_double($d, $d) };
24ok(ref($e), 'is an object');
25like(ref($e), qr/ArithUnaryFunction/, "is an ArithUnaryFunction");
26
27#
28# complex case
29#
30
31my $c = eval { make_Identity_complex() };
32ok(ref($c), 'is an object');
33like(ref($c), qr/ArithUnaryFunction/, "is an ArithUnaryFunction");
34
35my $f = eval { make_Multiplies_complex_complex_complex_complex($c, $c) };
36ok(ref($f), 'is an object');
37like(ref($f), qr/ArithUnaryFunction/, "is an ArithUnaryFunction");
38
39#
40# Mix case
41#
42
43my $g = eval { make_Multiplies_double_double_complex_complex($d, $c) };
44ok(ref($f), 'is an object');
45like(ref($f), qr/ArithUnaryFunction/, "is an ArithUnaryFunction");
46
47my $h = eval { make_Multiplies_complex_complex_double_double($c, $d) };
48ok(ref($h), 'is an object');
49like(ref($h), qr/ArithUnaryFunction/, "is an ArithUnaryFunction");