-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gather/take + try/catch failure #9
Comments
Test case: #!/usr/bin/perl
use strict;
use warnings;
use Test::More;
BEGIN {
plan skip_all => "Syntax::Keyword::Gather >= 1.000 is not available"
unless eval { require Syntax::Keyword::Gather;
Syntax::Keyword::Gather->VERSION( '1.000' ) };
plan skip_all => "Syntax::Keyword::Try >= 0.07 is not available"
unless eval { require Syntax::Keyword::Try;
Syntax::Keyword::Try->VERSION( '0.07' ) };
Syntax::Keyword::Gather->import;
Syntax::Keyword::Try->import;
diag( "Syntax::Keyword::Gather $Syntax::Keyword::Gather::VERSION, " .
"Syntax::Keyword::Try $Syntax::Keyword::Try::VERSION" );
}
# take inside try
{
my @gathered = gather {
take 1;
try {
take 2;
}
catch { }
take 3;
};
is_deeply( \@gathered, [ 1 .. 3 ],
'take inside try'
);
}
# take inside catch
{
my @gathered = gather {
take 4;
try {
die "Oopsie";
}
catch {
take 5;
}
take 6;
};
is_deeply( \@gathered, [ 4 .. 6 ],
'take inside catch'
);
}
done_testing; |
Yields output:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've been testing out pairs of syntax-extension modules, and I have encountered the case that
Syntax::Keyword::Gather
+Syntax::Keyword::Try
don't quite interact properly.A
take
inside atry
block appears to go unnoticed. Oddly though,take
insidecatch
works fine.I'm unsure yet if it's an issue with SKG or SKT, but I thought I'd report here so you're aware.
The text was updated successfully, but these errors were encountered: