1#!/usr/bin/perl 2use strict; 3use warnings; 4use Test::More qw(no_plan); # tests => 7; 5use ExtUtils::ParseXS::Utilities qw( 6 assign_func_args 7); 8 9#sub assign_func_args { 10# my ($self, $argsref, $class) = @_; 11# return join(", ", @func_args); 12 13my ($self, @args, $class); 14my ($func_args, $expected); 15 16@args = qw( alpha beta gamma ); 17$self->{in_out}->{alpha} = 'OUT'; 18$expected = q|&alpha, beta, gamma|; 19$func_args = assign_func_args($self, \@args, $class); 20is( $func_args, $expected, 21 "Got expected func_args: in_out true; class undefined" ); 22 23@args = ( 'My::Class', qw( beta gamma ) ); 24$self->{in_out}->{beta} = 'OUT'; 25$class = 'My::Class'; 26$expected = q|&beta, gamma|; 27$func_args = assign_func_args($self, \@args, $class); 28is( $func_args, $expected, 29 "Got expected func_args: in_out true; class defined" ); 30 31@args = ( 'My::Class', qw( beta gamma ) ); 32$self->{in_out}->{beta} = ''; 33$class = 'My::Class'; 34$expected = q|beta, gamma|; 35$func_args = assign_func_args($self, \@args, $class); 36is( $func_args, $expected, 37 "Got expected func_args: in_out false; class defined" ); 38 39@args = qw( alpha beta gamma ); 40$self->{in_out}->{alpha} = ''; 41$class = undef; 42$expected = q|alpha, beta, gamma|; 43$func_args = assign_func_args($self, \@args, $class); 44is( $func_args, $expected, 45 "Got expected func_args: in_out false; class undefined" ); 46 47pass("Passed all tests in $0"); 48