This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix long-standing bug in t/op/inc.t, whereby ok() ignored a failed match.
authorNicholas Clark <nick@ccl4.org>
Sat, 12 Mar 2011 22:16:46 +0000 (22:16 +0000)
committerNicholas Clark <nick@ccl4.org>
Sat, 12 Mar 2011 22:20:25 +0000 (22:20 +0000)
commit2353548ef4fdc07f036560213168410c87b73807
tree3bf83a4e4be0e5dcb5c12e8820a07673ba75323d
parent7db8714f1745a8bf9fbf94b21672ba5e3577fd4f
Fix long-standing bug in t/op/inc.t, whereby ok() ignored a failed match.

Unlike test.pl and Test::More, the home-rolled ok() in t/op/inc.t didn't have
a prototype. Hence its arguments are in *list* context, meaning that any match
will return an *empty list* if it fails. Provided ok() was called with a
second, true, parameter, the failed match would not be noticed, because ok()
would register a test pass, because it would now be testing the (intended)
second parameter.

Add a prototype, and fix the logic for the tests affected.
Fortunately this wasn't concealing any bugs.
t/op/inc.t