Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into feature/inject_BEGIN
- Loading branch information
Showing
9 changed files
with
496 additions
and
488 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,54 @@ | ||
#!/usr/bin/perl | ||
|
||
use strict; | ||
use warnings; | ||
|
||
use Test::More; | ||
|
||
plan skip_all => "This only applies to Perls before 5.10" if $] >= 5.010; | ||
|
||
use Method::Signatures; | ||
|
||
{ | ||
eval | ||
q{ | ||
func neg_and_odd_and_prime ($x where [0..10]) { | ||
return 1; | ||
} | ||
}; | ||
|
||
like $@, qr{\Q'where' constraint only available under Perl 5.10 or later.\E}, | ||
"Perls <5.10 properly error out on where constraints"; | ||
} | ||
|
||
{ | ||
eval | ||
q{ | ||
package Stuff; | ||
use Method::Signatures; | ||
method add($this //= 23, $that //= 42) { | ||
return $this + $that; | ||
} | ||
}; | ||
|
||
like $@, qr{\Q'//=' defaults only available under Perl 5.10 or later.\E}, | ||
"Perls <5.10 properly error out on //= declaration"; | ||
} | ||
|
||
{ | ||
eval | ||
q{ | ||
package Stuff; | ||
use Method::Signatures; | ||
method add($this = 23 when '', $that = 42 when '') { | ||
no warnings 'uninitialized'; | ||
return $this + $that; | ||
} | ||
}; | ||
|
||
like $@, qr{\Q'when' modifier on default only available under Perl 5.10 or later.\E}, | ||
"Perls <5.10 properly error out on 'when' conditions"; | ||
} | ||
|
||
done_testing; |
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
Oops, something went wrong.