Skip to content

Commit

Permalink
pat_advanced.t: fix two tests
Browse files Browse the repository at this point in the history
If two pieces of code are executed to see if they produce exactly the
same warning, the scalar holding the warning needs to be cleared in
between, otherwise the second test is useless if the first one passes
and the second piece of code doesn’t warn.
  • Loading branch information
Father Chrysostomos committed May 27, 2013
1 parent f81b1f8 commit 24ee355
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions t/re/pat_advanced.t
Expand Up @@ -1020,6 +1020,7 @@ sub run_tests {
undef $w;
eval q [is("\N{TOO MANY SPACES}", "TOO MANY SPACES", "Multiple spaces in character name works")];
like ($w, qr/A sequence of multiple spaces in a charnames alias definition is deprecated/, "... but returns a deprecation warning");
undef $w;
eval q [use utf8; is("\N{TOO MANY SPACES}", "TOO MANY SPACES", "Same under 'use utf8': they work")];
like ($w, qr/A sequence of multiple spaces in a charnames alias definition is deprecated/, "... but return a deprecation warning");
{
Expand Down Expand Up @@ -1051,6 +1052,7 @@ sub run_tests {
undef $w;
eval q [is("\N{TRAILING SPACE }", "TRAILING SPACE ", "Trailing space in character name works")];
like ($w, qr/Trailing white-space in a charnames alias definition is deprecated/, "... but returns a deprecation warning");
undef $w;
eval q [use utf8; is("\N{TRAILING SPACE }", "TRAILING SPACE ", "Same under 'use utf8': they work")];
like ($w, qr/Trailing white-space in a charnames alias definition is deprecated/, "... but returns a deprecation warning");
{
Expand Down

0 comments on commit 24ee355

Please sign in to comment.