9 use MakeMaker::Test::Utils;
10 use Test::More tests => 6;
13 my $TB = Test::More->builder;
15 BEGIN { use_ok('ExtUtils::MM') }
17 my $mm = bless { NAME => "Foo" }, 'MM';
18 isa_ok($mm, 'ExtUtils::MakeMaker');
19 isa_ok($mm, 'ExtUtils::MM_Any');
23 my($code, $switches, $expect, $name) = @_;
24 my $cmd = $mm->oneliner($code, $switches);
25 $cmd =~ s{\$\(ABSPERLRUN\)}{$^X};
27 # VMS likes to put newlines at the end of commands if there isn't
29 $expect =~ s/([^\n])\z/$1\n/ if $^O eq 'VMS';
31 $TB->is_eq(scalar `$cmd`, $expect, $name) || $TB->diag("oneliner:\n$cmd");
34 # Lets see how it deals with quotes.
35 try_oneliner(q{print "foo'o", ' bar"ar'}, [], q{foo'o bar"ar}, 'quotes');
37 # How about dollar signs?
38 try_oneliner(q{$PATH = 'foo'; print $PATH},[], q{foo}, 'dollar signs' );
41 try_oneliner(q{print 'foo'}, ['-l'], "foo\n", 'switches' );
43 # XXX gotta rethink the newline test. The Makefile does newline
44 # escaping, then the shell.