diff options
author | Paul Johnson <paul@pjcj.net> | 2001-07-12 06:14:11 +0200 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-07-12 13:05:46 +0000 |
commit | ae7d165c0b89e5ee4f4efe1fcd0b5806caf58351 (patch) | |
tree | 3ca6dd40179096c5469c469bc0ef784721e793a0 /t | |
parent | 983f8c39d1d673620d5153b40c61e46afb5d2df5 (diff) | |
download | perl-ae7d165c0b89e5ee4f4efe1fcd0b5806caf58351.tar.gz |
More accurate line numbers in messages
Message-ID: <20010712041411.A3467@pjcj.net>
(With prototyping and multiplicity tweaks.)
p4raw-id: //depot/perl@11305
Diffstat (limited to 't')
-rw-r--r-- | t/lib/warnings/util | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/t/lib/warnings/util b/t/lib/warnings/util index e82d6a6617..4e960c1ea1 100644 --- a/t/lib/warnings/util +++ b/t/lib/warnings/util @@ -106,3 +106,53 @@ no warnings 'portable' ; $a = oct "0047777777777" ; EXPECT Octal number > 037777777777 non-portable at - line 5. +######## +# util.c +use warnings; +$x = 1; +if ($x) { + print $y; +} +EXPECT +Name "main::y" used only once: possible typo at - line 5. +Use of uninitialized value in print at - line 5. +######## +# util.c +use warnings; +$x = 1; +if ($x) { + $x++; + print $y; +} +EXPECT +Name "main::y" used only once: possible typo at - line 6. +Use of uninitialized value in print at - line 6. +######## +# util.c +use warnings; +$x = 0; +if ($x) { + print "1\n"; +} elsif (!$x) { + print $y; +} else { + print "0\n"; +} +EXPECT +Name "main::y" used only once: possible typo at - line 7. +Use of uninitialized value in print at - line 7. +######## +# util.c +use warnings; +$x = 0; +if ($x) { + print "1\n"; +} elsif (!$x) { + $x++; + print $y; +} else { + print "0\n"; +} +EXPECT +Name "main::y" used only once: possible typo at - line 8. +Use of uninitialized value in print at - line 8. |