Changes for Devel-Declare
+ - Adjust toke_scan_str logic to always leave the prefix part of
+ linestr unchanged.
+
0.006007 - 12 Sep 2011
- Depend on B::Hooks::OP::Check version 0.19, which fixes a serious bug in
how it interacts with other modules that hook ops.
"Devel::Declare can't continue");
if (!s)
return 0;
- if (s <= base_s) {
+ if (s <= base_s || memcmp(SvPVX(line_copy), SvPVX(PL_linestr), offset)) {
s += SvCUR(line_copy);
sv_catsv(line_copy, PL_linestr);
dd_set_linestr(aTHX_ SvPV_nolen(line_copy));
use strict;
use warnings;
-use Test::More tests => 5;
+use Test::More tests => 20;
# This test script is derived from a MooseX::Method::Signatures test,
# which is sensitive to some details of Devel::Declare behaviour that
die "No name\n" unless defined $name;
my $proto = $ctx->strip_proto;
die "Wrong declarator\n" unless $ctx->declarator eq "mtfnpy";
+ $proto =~ s/\n/\\n/g;
$ctx->inject_if_block(qq[BEGIN { @{[__PACKAGE__]}::inject_after_scope(', q[${name}]);') } unshift \@_, "${proto}";], "(sub ");
my $compile_stash = $ctx->get_curstash_name;
$ctx->shadow(sub {
foo(qw(a b c));
+mtfnpy bar (ex
+tra) {
+ is scalar(@_), 4;
+ is $_[0], "ex\ntra";
+ is $_[1], "a";
+ is $_[2], "b";
+ is $_[3], "c";
+}
+
+bar(qw(a b c));
+
+mtfnpy baz (ex
+tra extra extra) {
+ is scalar(@_), 4;
+ is $_[0], "ex\ntra extra extra";
+ is $_[1], "a";
+ is $_[2], "b";
+ is $_[3], "c";
+}
+
+baz(qw(a b c));
+
+mtfnpy quux (ex
+tra
+extra) {
+ is scalar(@_), 4;
+ is $_[0], "ex\ntra\nextra";
+ is $_[1], "a";
+ is $_[2], "b";
+ is $_[3], "c";
+}
+
+quux(qw(a b c));
+
1;