diag.t: Use correct variable
authorFather Chrysostomos <sprout@cpan.org>
Wed, 27 Jun 2012 07:45:34 +0000 (00:45 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Wed, 27 Jun 2012 07:52:54 +0000 (00:52 -0700)
Multiline messages are listed in the __DATA__ section with spaces
instead of line breaks.  When adding proper support for multiline err-
ors earlier, I made a slight mistake and caused multiline to-do mess-
ages to skip the to-do code path, because I was looking them up via
the name with line breaks ($name), rather than the name with line
breaks modified ($key).

This was causing it to fall down to the pass($key) below.

I want to add more tests down there, which will fail for multiline
to-do items.

t/porting/diag.t

index 4eef1df..c8ae873 100644 (file)
@@ -322,12 +322,12 @@ sub check_message {
       $ret = 1;
       if ( $entries{$key}{seen}++ ) {
         # no need to repeat entries we've tested
-      } elsif ($entries{$name}{todo}) {
+      } elsif ($entries{$key}{todo}) {
         TODO: {
           no warnings 'once';
           local $::TODO = 'in DATA';
           # There is no listing, but it is in the list of exceptions.  TODO FAIL.
-          fail($name);
+          fail($key);
           diag(
             "    Message '$name'\n    from $codefn line $. is not listed in $pod\n".
             "    (but it wasn't documented in 5.10 either, so marking it TODO)."