-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement and test use perl5i::2 -skip => [feature1, feature2];
Needs docs.
- Loading branch information
Showing
2 changed files
with
66 additions
and
3 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,43 @@ | ||
#!/usr/bin/env perl | ||
|
||
use Test::More; | ||
|
||
note "skipping a feature"; | ||
{ | ||
# Needs its own package because perl5i is not always lexical | ||
package Foo1; | ||
|
||
use perl5i::latest -skip => ['Signatures']; | ||
|
||
::ok !eval q[method foo { 42 }; 1]; | ||
::ok !defined &foo; | ||
} | ||
|
||
note "skipping autodie"; | ||
{ | ||
# Needs its own package because perl5i is not always lexical | ||
package Foo2; | ||
|
||
use perl5i::latest -skip => ["autodie"]; | ||
open my $fh, "/i/do/not/exist/alfkjaldjlf"; | ||
::pass("autodie is disabled"); | ||
} | ||
|
||
note "unknown feature error"; | ||
{ | ||
my $feature = 'Orbital Mind Control Lasers'; | ||
ok !eval { | ||
perl5i::latest->import( -skip => [$feature] ); | ||
}; | ||
is $@, sprintf "Unknown feature '%s' in skip list at %s line %d.\n", $feature, $0, __LINE__-2; | ||
} | ||
|
||
note "unknown import parameter"; | ||
{ | ||
ok !eval { | ||
perl5i::latest->import( wibble => "what" ); | ||
}; | ||
is $@, sprintf "Unknown parameters 'wibble => what' in import list at %s line %d.\n", $0, __LINE__-2; | ||
} | ||
|
||
done_testing; |