7 use File::Temp qw( tempdir );
8 use Test::More tests => 2;
10 use ExtUtils::ParseXS::Utilities qw(
16 my ($type_kind_ref, $proto_letter_ref, $input_expr_ref, $output_expr_ref);
17 my $typemap = 'typemap';
18 my $tdir = tempdir( CLEANUP => 1 );
19 chdir $tdir or croak "Unable to change to tempdir for testing";
21 ($type_kind_ref, $proto_letter_ref, $input_expr_ref, $output_expr_ref)
22 = process_typemaps( $typemap, $tdir );
24 like( $@, qr/Can't find \Q$typemap\E in \Q$tdir\E/, #'
25 "Got expected result for no typemap in current directory" );
30 my ($type_kind_ref, $proto_letter_ref, $input_expr_ref, $output_expr_ref);
31 my $typemap = [ qw( pseudo typemap ) ];
32 my $tdir = tempdir( CLEANUP => 1 );
33 chdir $tdir or croak "Unable to change to tempdir for testing";
34 open my $IN, '>', 'typemap' or croak "Cannot open for writing";
36 close $IN or croak "Cannot close after writing";
38 ($type_kind_ref, $proto_letter_ref, $input_expr_ref, $output_expr_ref)
39 = process_typemaps( $typemap, $tdir );
41 like( $@, qr/Can't find pseudo in \Q$tdir\E/, #'
42 "Got expected result for no typemap in current directory" );