Skip to content

Conversation

@wchristian
Copy link
Contributor

This PR is for https://rt.cpan.org/Ticket/Display.html?id=121013 and still requires some feedback.

local $SIG{__WARN__} = sub { $warning = shift };

my $var = dualvar(undef, undef);
like($warning, qr/Use of uninitialized value in subroutine entry/, 'undef arg warning');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aren't these warnings localised to different languages? Or am I being confused about $! ?

ok( $var == undef, 'Numeric value');
ok( $var eq undef, 'String value');

my $var2 = dualvar(2.2, undef);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You probably want to

undef $warning;

just before each additional test block to ensure that it's not just remaining from the previous

local $SIG{__WARN__} = sub { $warning = shift };

my @c = prototype();
is( scalar @c, 0, 'no arg results in empty list'); # XXX
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent whitespacing - probably wants to be

is(scalar @c, 0, 'no arg results in empty list'); # XXX

like($warning, qr/Use of uninitialized value in subroutine prototype/, 'no arg results in undef arg warning');
undef $warning;

is( prototype(undef), undef, 'undef arg');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants