]> git.vpit.fr Git - perl/modules/Mac-NSGetExecutablePath.git/blob - t/10-base.t
Update VPIT::TestHelpers to 15e8aee3
[perl/modules/Mac-NSGetExecutablePath.git] / t / 10-base.t
1 #!perl
2
3 use strict;
4 use warnings;
5
6 use Test::More tests => 6;
7
8 use Mac::NSGetExecutablePath 'NSGetExecutablePath';
9
10 my $path = NSGetExecutablePath();
11
12 ok defined($path), 'NSGetExecutablePath() does not return undef';
13 cmp_ok length($path), '>', 0,
14                    'NSGetExecutablePath() returns something of positive length';
15
16 my $v = `$path -v`;
17
18 ok   defined($v), '`NSGetExecutablePath() -v` returns something';
19 like $v, qr/This is perl\b/, 'NSGetExecutablePath() points to a perl';
20
21 $v = `$path -le 'print "\$]"'`;
22 ok defined($v), q{`NSGetExecutablePath() -le 'print "$]"'` returns something};
23 1 while chomp $v;
24 is $v, "$]", 'NSGetExecutablePath() points to the same perl version';