This repository has been archived by the owner on Mar 7, 2019. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added alien_interpolate method (for command interpolation) with tests…
…. and alien_share_folder method/property which returns full path to share_dir
- Loading branch information
Showing
2 changed files
with
59 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
use strict; | ||
use warnings; | ||
|
||
use Test::More; | ||
use Alien::Base::ModuleBuild; | ||
use File::Spec::Functions 'rel2abs'; | ||
|
||
my $builder = { | ||
share_dir => 't', | ||
}; | ||
|
||
bless $builder, 'Alien::Base::ModuleBuild'; | ||
|
||
is( $builder->alien_interpolate('%phello'), $builder->alien_exec_prefix . 'hello', 'prefix interpolation'); | ||
is( $builder->alien_interpolate('%%phello'), '%phello', 'no prefix interpolation with escape'); | ||
|
||
my $path = rel2abs "t"; | ||
is( $builder->alien_interpolate('thing other=%s'), "thing other=$path", 'share_dir interpolation'); | ||
is( $builder->alien_interpolate('thing other=%%s'), 'thing other=%s', 'no share_dir interpolation with escape'); | ||
|
||
done_testing; | ||
|