summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMatthew Horsfall (alh) <wolfsage@gmail.com>2011-08-22 21:26:26 -0400
committerFather Chrysostomos <sprout@cpan.org>2011-08-22 23:39:58 -0700
commit524e918826a7e5c1e42dc42a70614584081e8300 (patch)
tree76a3d5d4a0d32ebeaf71a723435b81d9fced784c /lib
parentd93f0209d1eb23b074952eedc905b475e18f4035 (diff)
downloadperl-524e918826a7e5c1e42dc42a70614584081e8300.tar.gz
Strip S<> formatting codes from diagnostics output
Update spacing Don't break S<20 questions> across lines, update test to be accurate
Diffstat (limited to 'lib')
-rw-r--r--lib/diagnostics.pm8
-rw-r--r--lib/diagnostics.t9
2 files changed, 14 insertions, 3 deletions
diff --git a/lib/diagnostics.pm b/lib/diagnostics.pm
index 7079d2508f..a40da9ea14 100644
--- a/lib/diagnostics.pm
+++ b/lib/diagnostics.pm
@@ -185,7 +185,7 @@ use 5.009001;
use Carp;
$Carp::Internal{__PACKAGE__.""}++;
-our $VERSION = '1.24';
+our $VERSION = '1.25';
our $DEBUG;
our $VERBOSE;
our $PRETTY;
@@ -344,6 +344,9 @@ my %msg;
? italic($sect) . ' in ' . italic($page)
: italic($page)
/ges;
+ s/S<(.*?)>/
+ $1
+ /ges;
} else {
s/C<<< (.*?) >>>|C<< (.*?) >>|[BC]<(.*?)>/$+/gs;
s/[IF]<(.*?)>/$1/gs;
@@ -355,6 +358,9 @@ my %msg;
? qq '"$sect" in $page'
: $page
/ges;
+ s/S<(.*?)>/
+ $1
+ /ges;
}
unless (/^=/) {
if (defined $header) {
diff --git a/lib/diagnostics.t b/lib/diagnostics.t
index 31a5802c2b..4e5ab8230b 100644
--- a/lib/diagnostics.t
+++ b/lib/diagnostics.t
@@ -5,7 +5,7 @@ BEGIN {
@INC = 'lib';
}
-use Test::More tests => 9;
+use Test::More tests => 10;
BEGIN {
my $w;
@@ -55,9 +55,14 @@ $warning = '';
warn "Execution of -e aborted due to compilation errors.\n";
like $warning, qr/The final summary message/, 'Periods at end of line';
-
# Test for %d/%u
seek STDERR, 0,0;
$warning = '';
warn "Bad arg length for us, is 4, should be 42";
like $warning, qr/In C parlance/, '%u works';
+
+# Strip S<>
+seek STDERR, 0,0;
+$warning = '';
+warn "syntax error";
+like $warning, qr/cybernetic version of 20 questions/s, 'strip S<>';