-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
72c9773
commit 5f0fc44
Showing
1 changed file
with
30 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
use strict; | ||
use warnings; | ||
|
||
use Test::More; | ||
|
||
# ABSTRACT: Test the set-display functionality | ||
|
||
use Module::Path::Simplify; | ||
|
||
my $s = Module::Path::Simplify->new(); | ||
|
||
my $short = $s->simplify( $INC{'Module/Path/Simplify.pm'} ); # Store name in cache. | ||
|
||
cmp_ok( scalar $s->aliases->names, '==', 1, "One entry in cache" ); | ||
|
||
for my $alias ( $s->aliases->names ) { | ||
$s->aliases->set_display( $alias, "ROBOTS" ); | ||
like( $s->aliases->get_path_suffixed( $alias ), qr/ \(\Q$alias\E\)/, "Set display causes suffixes to show up" ); | ||
like( $s->aliases->get_display( $alias ), qr/\AROBOTS/, "Set display causes get_display to change" ); | ||
} | ||
|
||
like( $short = $s->simplify( $INC{'Module/Path/Simplify.pm'} ), qr{\AROBOTS/}, "Simplified path now has custom alias" ); | ||
note $short; | ||
|
||
note $s->pp_aliases; | ||
|
||
|
||
done_testing; | ||
|
||
|