1 ################################################################################
3 # !!!!! Do NOT edit this file directly! !!!!!
5 # Edit mktests.PL and/or parts/inc/call instead.
7 # This file was automatically generated from the definition files in the
8 # parts/inc/ subdirectory by mktests.PL. To learn more about how all this
9 # works, please read the F<HACKERS> file that came with this distribution.
11 ################################################################################
14 if ($ENV{'PERL_CORE'}) {
16 @INC = ('../lib', '../ext/Devel/PPPort/t') if -d '../lib' && -d '../ext';
17 require Config; import Config;
19 if (" $Config{'extensions'} " !~ m[ Devel/PPPort ]) {
20 print "1..0 # Skip -- Perl configured without Devel::PPPort module\n";
30 require 'testutil.pl' if $@;
43 package Devel::PPPort;
46 @ISA = qw(DynaLoader);
47 bootstrap Devel::PPPort;
54 join(':', @$a) eq join(':', @$b);
62 @_, defined wantarray ? wantarray ? 'x' : 'y' : 'z';
65 my $obj = bless [], 'Foo';
69 return 'bad_self' unless @_ && ref $_[0] && ref($_[0]) eq 'Foo';
74 @_, defined wantarray ? wantarray ? 'x' : 'y' : 'z';
80 # flags args expected description
81 [ &Devel::PPPort::G_SCALAR, [ ], [ qw(y 1) ], '0 args, G_SCALAR' ],
82 [ &Devel::PPPort::G_SCALAR, [ qw(a p q) ], [ qw(y 1) ], '3 args, G_SCALAR' ],
83 [ &Devel::PPPort::G_ARRAY, [ ], [ qw(x 1) ], '0 args, G_ARRAY' ],
84 [ &Devel::PPPort::G_ARRAY, [ qw(a p q) ], [ qw(b p x 3) ], '3 args, G_ARRAY' ],
85 [ &Devel::PPPort::G_DISCARD, [ ], [ qw(0) ], '0 args, G_DISCARD' ],
86 [ &Devel::PPPort::G_DISCARD, [ qw(a p q) ], [ qw(0) ], '3 args, G_DISCARD' ],
89 my ($flags, $args, $expected, $description) = @$test;
90 print "# --- $description ---\n";
91 ok(eq_array( [ &Devel::PPPort::call_sv(\&f, $flags, @$args) ], $expected));
92 ok(eq_array( [ &Devel::PPPort::call_sv(*f, $flags, @$args) ], $expected));
93 ok(eq_array( [ &Devel::PPPort::call_sv('f', $flags, @$args) ], $expected));
94 ok(eq_array( [ &Devel::PPPort::call_pv('f', $flags, @$args) ], $expected));
95 ok(eq_array( [ &Devel::PPPort::call_argv('f', $flags, @$args) ], $expected));
96 ok(eq_array( [ &Devel::PPPort::eval_sv("f(qw(@$args))", $flags) ], $expected));
97 ok(eq_array( [ &Devel::PPPort::call_method('meth', $flags, $obj, @$args) ], $expected));
100 ok(&Devel::PPPort::eval_pv('f()', 0), 'y');
101 ok(&Devel::PPPort::eval_pv('f(qw(a b c))', 0), 'y');
103 ok(!defined $::{'less::'}, 1, "Hadn't loaded less yet");
104 Devel::PPPort::load_module(0, "less", undef);
105 ok(defined $::{'less::'}, 1, "Have now loaded less");