summaryrefslogtreecommitdiff
path: root/lib/diagnostics.t
Commit message (Collapse)AuthorAgeFilesLines
* diagnostics.pm; Enhance to accept nested listsKarl Williamson2016-06-171-5/+20
| | | | | | Prior to this patch, this module assumed every =item was for a diagnostic. Now it keeps track, and so a given diagnostic can have a list within it.
* Allow \N{named seq} in qr/[...]/Karl Williamson2014-09-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit changes the regex handler to properly match in many instances a \N{named sequence} in a bracketed character class. A named sequence is one which consists of a string of multiple characters but given one name. Unicode has hundreds of them, like LATIN CAPITAL LETTER A WITH MACRON AND GRAVE. These are encoded by Unicode when there is some user community that thinks of the conglomeration as a single unit, but there was no prior standard that had it so, and it is possible to encode it in Unicode using other means, typically a sequence of a base character followed by some combining marks. (If there had not been such a prior standard, 8859-1, things like LATIN CAPITAL LETTER A WITH GRAVE would have been put into Unicode this way too.) If they did not do it this way, they would run out of availble code points much sooner. Not having these as single characters adds a burden to the programmer having to deal with them. Hiding this detail as much as possible makes it easier to program. This commit hides this in one more place than previously. It takes advantage of the infrastructure added some releases ago dealing with the fact that the match of some single characters case-insensitively can be 2 or even 3 characters. "ss" =~ /[ß]/i; is the most prominent example. We earlier discovered that /[^ß]/ leads to unexpected behavior, and using one of these sequences as an endpoint in a range is also unclear as to what is meant. This commit leaves existing behavior for those cases. That behavior is to use just the first code point in the sequence for regular [...], and to generate a fatal syntax error for (?[...]).
* [perl #3330] warn on increment of an non number/non-magically incable valueTony Cook2014-07-031-3/+0
| | | | | | The original version of this patch, introduced in v5.19.2-389-g8140a7a, warned confusingly when incrementing strings like "123abc". This version includes the fix patch from [perl
* regcomp.c: Move code into a functionKarl Williamson2014-05-301-1/+1
| | | | This is in preparation for it to be called from another place
* [perl #121771] Revert the new warning for ++ on non- /\A[a-zA-Z]+[0-9]*\z/Tony Cook2014-05-071-0/+3
| | | | | | | | | | | | | | | | This failed as in it was producing: Argument "123abc" treated as 0 in increment (++) at -e line 1. when the user incremented that value (which is a lie). This reverts commits 8140a7a801e37d147db0e5a8d89551d9d77666e0 and 2cd5095e471e1d84dc9e0b79900ebfd66aabc909. I expect to revert this commit, and add fixes, after 5.20 is released. Conflicts: pod/perldiag.pod
* lib/diagnostics.t: Add testKarl Williamson2013-12-261-1/+6
| | | | | This adds a test so that both =item lines of an adjacent pair get tested.
* lib/diagnostics.t: Use different test dataKarl Williamson2013-12-261-2/+2
| | | | | | | | | | | This is testing that things work for two adjacent =item lines in perldiag.pod that share the same description. However a future commit will change perldiag.pod so that one of the specific adjacent lines previously used here will be removed. Therefore, choose a different set of adjacent lines that aren't scheduled to be changed. This adds a comment in perldiag that the newly chosen adjacent lines are thus used in diagnostics.t
* RT-119817 - Treat =back as the end of a warning description.Matthew Horsfall (alh)2013-09-171-1/+43
| | | | | This keeps any trailing data in the file from showing up as part of the last warning's description.
* Test multiline links in diagnostics.tFather Chrysostomos2013-08-121-1/+9
|
* diagnostics.t: Adjust testsFather Chrysostomos2013-07-131-1/+1
| | | | They are sensitive to changes in perldiag.pod
* 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