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