summaryrefslogtreecommitdiff
path: root/lib/diagnostics.t
diff options
context:
space:
mode:
Diffstat (limited to 'lib/diagnostics.t')
-rw-r--r--lib/diagnostics.t35
1 files changed, 34 insertions, 1 deletions
diff --git a/lib/diagnostics.t b/lib/diagnostics.t
index b6deb2023d..34ea36c6ff 100644
--- a/lib/diagnostics.t
+++ b/lib/diagnostics.t
@@ -4,7 +4,7 @@ BEGIN {
chdir '..' if -d '../pod' && -d '../t';
@INC = 'lib';
require './t/test.pl';
- plan(20);
+ plan(24);
}
BEGIN {
@@ -96,6 +96,39 @@ like $warning,
qr/You tried to load a file.*Perl could not compile/s,
'multiline errors';
+# Multiline entry in perldiag.pod
+seek STDERR, 0,0;
+$warning = '';
+warn "Using just the first character returned by \\N{} in character class in regex; marked by <-- HERE in m/%s/";
+like $warning,
+ qr/A charnames handler may return a sequence/s,
+ 'multi-line entries in perldiag.pod match';
+
+# ; at end of entry in perldiag.pod
+seek STDERR, 0,0;
+$warning = '';
+warn "Perl folding rules are not up-to-date for 0xa; please use the perlbug utility to report;";
+like $warning,
+ qr/regular expression folding rules/s,
+ '; works at the end of entries in perldiag.pod';
+
+# Differences in spaces in warnings (Why not be nice and accept them?)
+seek STDERR, 0,0;
+$warning = '';
+warn "Assignment to both a list and a scalar\n";
+like $warning,
+ qr/2nd and 3rd/s,
+ 'spaces in warnings are matched lightly';
+
+# Differences in spaces in warnings with a period at the end
+seek STDERR, 0,0;
+$warning = '';
+warn "perl: warning: Setting locale failed.\n";
+like $warning,
+ qr/The whole warning/s,
+ 'spaces in warnings with periods at the end are matched lightly';
+
+
*STDERR = $old_stderr;
# These tests use a panic under the hope that the description is not likely