summaryrefslogtreecommitdiff
path: root/lib/diagnostics.t
Commit message (Collapse)AuthorAgeFilesLines
* fix various podcheck nitsDavid Golden2013-05-231-1/+1
|
* Add regcomp.c warning checks to t/porting/diag.t.Matthew Horsfall (alh)2012-12-271-1/+1
| | | | | | * Support regcomp.c ckWARN and vWARN macros * Update pod/perldiag.pod for fixes discovered with new checks * Allow t/porting/diag.t to match printfs with flags more liberally
* RT-89642 - Don't treat ,; as special end-of-line characters.Matthew Horsfall (alh)2012-12-221-1/+34
| | | | | | Support multi-line "=item ..." expressions per the POD spec. This also allows warnings with white-space differences to match.
* diagnostics.t: Test BEGIN{die}Father Chrysostomos2012-07-291-1/+11
|
* Teach diagnostics.pm about %pFather Chrysostomos2012-06-291-1/+7
|
* diagnostics.t: Restore test name removed by f0e510fFather Chrysostomos2012-06-281-1/+2
|
* diagnostics.t: Tweak to get tests passingFather Chrysostomos2012-06-271-1/+1
| | | | I thought I had run it, hmm.
* In diagnostics.t, avoid passing a literal \n in the command to run.Nicholas Clark2012-01-021-2/+2
| | | | | | Express the one-liner with qq to interpolating \n to a newline character at execution time, instead of q quoting a literal newline character. Passing a literal newline character is not portable to all platforms.
* Fix up diagnostic.pm’s backtrace for multiline msgsFather Chrysostomos2011-12-261-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | I hope you agree this backtrace does not look very good: $ ./perl -Ilib -Mdiagnostics -e ' sub foo { bar () } sub bar { baz() } sub baz { die "Attempt to reload foo aborted.\nCompilation failed in require"} foo ' Attempt to reload foo aborted (#1) (F) You tried to load a file with use or require that failed to compile once already. Perl will not try to compile this file again unless you delete its entry from %INC. See "require" in perlfunc and "%INC" in perlvar. Compilation failed in require at -e line 1 (#2) (F) Perl could not compile a file specified in a require statement. Perl uses this generic message when none of the errors that it encountered were severe enough to halt compilation immediately. Uncaught exception from user code: Attempt to reload foo aborted. Compilation failed in require at -e line 1. main::baz() called at -e line 1 main::bar() called at -e line 1 main::foo() called at -e line 1
* Add support for multiline messages to splainFather Chrysostomos2011-12-261-3/+11
| | | | | | | | | | | | | | All the ‘Compilation failed’ messages are actually multiline mes- sages, like "Attempt to reload foo aborted.\nCompilation failed in require at ...". perldiag has separate entries for each line of the message, so it makes sense to have it look up each line. It can’t split it into lines by default, but must check for a possible description first, as sometimes syntax errors quote code with line breaks in it. I had to rip out the nasty file-wide lexical $_, as I couldn’t local- ise it, and I undid d923656e4 in the process.
* diagnostics.t: Test errors ending with dotsFather Chrysostomos2011-12-261-1/+7
|
* Fix diagnostic.pm’s backtracesFather Chrysostomos2011-12-261-4/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently a user-defined error message is printed out like this: ----- Uncaught exception from user code: panick: at -e line 1. at -e line 1 main::baz() called at -e line 1 main::bar() called at -e line 1 main::foo() called at -e line 1 ----- Errors generated from perl itself are printed like this: ----- panic: at -e line 1 (#1) (P) An internal error. Uncaught exception from user code: panic: at -e line 1. at -e line 1 main::baz() called at -e line 1 main::bar() called at -e line 1 main::foo() called at -e line 1 ----- By using Carp::confess(), we end up with a screwy backtrace. Some- times it just ends up repeating the error and line number: ----- panic: at -e line 1 (#1) (P) An internal error. Uncaught exception from user code: panic: at -e line 1. at -e line 1 ----- Uncaught exception from user code: panick at -e line 1. at -e line 1 ----- This commit cleans these up to print like this: ----- Uncaught exception from user code: panick: at -e line 1. main::baz() called at -e line 1 main::bar() called at -e line 1 main::foo() called at -e line 1 ----- panic: at -e line 1 (#1) (P) An internal error. Uncaught exception from user code: panic: at -e line 1. main::baz() called at -e line 1 main::bar() called at -e line 1 main::foo() called at -e line 1 ----- panic: at -e line 1 (#1) (P) An internal error. Uncaught exception from user code: panic: at -e line 1. ----- Uncaught exception from user code: panick at -e line 1. ----- You might ask: Why not remove the ‘uncaught exception’ message alto- gether after an error description. It’s because the error description is a diagnostic, which only prints once for each error or warning encountered. So you could have eval { die } somewhere else in the code, which causes a description to be printed. And later you have a die() that exits the program, but nothing gets printed. In other words, the description of the message does not replace the error.
* Convert diagnostics.t to test.plFather Chrysostomos2011-12-261-2/+2
| | | | so that runperl is available
* Teach splain about %XFather Chrysostomos2011-12-161-2/+8
|
* Strip S<> formatting codes from diagnostics outputMatthew Horsfall (alh)2011-08-221-2/+7
| | | | | | Update spacing Don't break S<20 questions> across lines, update test to be accurate
* RT #94988 - Support for %u in diagnostics.pm's printf()-format parserMatthew Horsfall (alh)2011-08-021-1/+8
|
* Test for [perl #87726] (warning from diagnostics.pm under -w)Father Chrysostomos2011-07-181-3/+8
|
* Allow items in perldiag.pod to match warnings when they have periods at the endMatthew Horsfall2011-07-081-1/+6
|
* Fix broken lib/diagnostics.tDavid Golden2011-02-161-1/+1
| | | | | Commit 96090e4 changed a diagnostic message, but didn't update lib/diagnostics.t
* Make diagnostics.pm understand messages sharing descriptionsFather Chrysostomos2011-02-121-1/+9
| | | | | | | | | | | | | | | We currently have entries in perldiag like this: =item Code point 0x%X is not Unicode, may not be portable =item Code point 0x%X is not Unicode, no properties match it; all inverse properties do (W utf8) You had a code point above the Unicode maximum of U+10FFFF. ... diagnostics.pm needs to know that the description applies to the first =item, as well as to the second.
* Improve diagnostics.pm’s link rendering.Father Chrysostomos2011-02-121-1/+14
| | | | | | | | | | | | | | | | | | The number of L<foo/bar> links in perldiag has grown over time, and diagnostics.pm has never been updated to render them nicely, resulting in output like this: Lexing code attempted to stuff non-Latin-1 character into Latin-1 input at lib/diagnostics.t line 36 (#3) (F) An extension is attempting to insert text into the current parse (using lex_stuff_pvn_flags|perlapi/lex_stuff_pvn_flags or similar), but tried to insert a character that couldn't be part of the current input. This is an inherent pitfall of the stuffing mechanism, and one of the reasons to avoid it. Where it is necessary to stuff, stuffing only plain ASCII is recommended. I’ve implemented some rudimentary L<> parsing, which should suffice for perldiag. I think using a real POD processor would be overkill.
* [perl #70337] perldiag: localtime(...) too largeFather Chrysostomos2009-11-131-1/+8
| | | | | | | | | The message ‘localtime(...) too large’ is not documented in perldiag. The attached patch adds it. I know it’s technically ‘%s(%.0f) too large’, but it’s easier for users to find it under ‘localtime’ and ‘gmtime’. I also had to modify diagnostics.pm to support %.0f, and I added a test, but I used a hack with STDERR that would make debugging very difficult to anyone else adding tests.
* Remove code specific to MacOS Classic from core testsRafael Garcia-Suarez2009-09-081-7/+2
|
* Integrate macperl patches #16926 and #16938;Jarkko Hietaniemi2002-05-311-2/+7
| | | | | | | | | | | | | | | | | | | | | Big MacPerl Testing Patch No. 2 Big MacPerl Testing Patch No. 3 p4raw-id: //depot/perl@16942 p4raw-integrated: from //depot/macperl@16937 'copy in' lib/Devel/SelfStubber.pm lib/Devel/SelfStubber.t lib/File/DosGlob.t lib/File/Path.t lib/File/Spec/t/Spec.t lib/File/Temp.pm lib/FindBin.t lib/Tie/File/t/09_gen_rs.t lib/lib.t t/comp/use.t utils/dprofpp.PL utils/splain.PL (@16123..) t/lib/MakeMaker/Test/Utils.pm (@16230..) lib/diagnostics.t (@16646..) lib/ExtUtils/t/00setup_dummy.t lib/ExtUtils/t/Command.t (@16730..) lib/lib_pm.PL (@16926..) lib/ExtUtils/MM_MacOS.pm lib/Test/Harness/Straps.pm lib/Test/Harness/t/callback.t lib/Test/Harness/t/strap-analyze.t lib/Test/Harness/t/test-harness.t (@16929..) p4raw-integrated: from //depot/macperl@16926 'merge in' lib/English.t (@16123..) ext/DynaLoader/DynaLoader_pm.PL (@16868..)
* The base.pm changes need this, too?Jarkko Hietaniemi2002-05-081-1/+1
| | | p4raw-id: //depot/perl@16490
* [ID 20010822.007] eval STRING & diagnostics.pm not mixingMichael G Schwern2001-08-221-27/+7
| | | | | Message-Id: <20010822200300.0D1638253@ool-18b93024.dyn.optonline.net> p4raw-id: //depot/perl@11726
* The Grand Trek: move the *.t files from t/ to lib/ and ext/.Jarkko Hietaniemi2001-06-181-0/+38
No doubt I made some mistakes like missed some files or misnamed some files. The naming rules were more or less: (1) if the module is from CPAN, follows its ways, be it t/*.t or test.pl. (2) otherwise if there are multiple tests for a module put them in a t/ (3) otherwise if there's only one test put it in Module.t (4) helper files go to module/ (locale, strict, warnings) (5) use longer filenames now that we can (but e.g. the compat-0.6.t and the Text::Balanced test files still were renamed to be more civil against the 8.3 people) installperl was updated appropriately not to install the *.t files or the help files from under lib. TODO: some helper files still remain under t/ that could follow their 'masters'. UPDATE: On second thoughts, why should they. They can continue to live under t/lib, and in fact the locale/strict/warnings helpers that were moved could be moved back. This way the amount of non-installable stuff under lib/ stays smaller. p4raw-id: //depot/perl@10676