~ubuntu-branches/ubuntu/trusty/libperl5i-perl/trusty-proposed

« back to all changes in this revision

Viewing changes to t/command_line_wrapper.t

  • Committer: Bazaar Package Importer
  • Author(s): Ivan Kohler
  • Date: 2010-05-08 17:42:00 UTC
  • Revision ID: james.westby@ubuntu.com-20100508174200-7ogg0zrimh9gvcuw
Tags: upstream-2.1.1
ImportĀ upstreamĀ versionĀ 2.1.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl
 
2
 
 
3
use perl5i::latest;
 
4
 
 
5
use Config;
 
6
use ExtUtils::CBuilder;
 
7
use File::Spec;
 
8
 
 
9
use Test::More;
 
10
 
 
11
my $perl5i;
 
12
my $script_dir = File::Spec->catdir("blib", "script");
 
13
for my $wrapper (qw(perl5i perl5i.bat)) {
 
14
    $perl5i = File::Spec->catfile($script_dir, $wrapper);
 
15
    last if -e $perl5i;
 
16
}
 
17
 
 
18
ok -e $perl5i, "perl5i command line wrapper was built";
 
19
 
 
20
ok system(qq[$perl5i "-Ilib" -e 1]) == 0, "  and it runs";
 
21
 
 
22
is `$perl5i "-Ilib" -e "say 'Hello'"`, "Hello\n", "Hello perl5i!";
 
23
 
 
24
like `$perl5i "-Ilib" -h`, qr/disable all warnings/, 'perl5i -h works as expected';
 
25
 
 
26
like `$perl5i "-Ilib" -e "\$^X->say"`, qr/perl5i/, '$^X is perl5i';
 
27
 
 
28
done_testing(5);