mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-09 18:30:16 +00:00
Merged fix-821696-pt-va-snippet-delimiters
This commit is contained in:
@@ -3598,9 +3598,9 @@ sub print_advice {
|
||||
foreach my $id ( @$advice ) {
|
||||
my $info = $adv->get_rule_info($id);
|
||||
my @desc = map {
|
||||
$_ .= '.' unless m/\.$/;
|
||||
$_ .= '.' unless m/[.?]$/;
|
||||
$_;
|
||||
} split(/\.\s{1,2}/, $info->{description} || '');
|
||||
} split(/(?<=[.?])\s{1,2}/, $info->{description} || '');
|
||||
$desc[1] ||= ""; # Some desc have only 1 sentence.
|
||||
my $desc = $verbose == 1 ? $desc[0] # terse
|
||||
: $verbose == 2 ? "$desc[0] $desc[1]" # fuller
|
||||
|
@@ -9,7 +9,7 @@ BEGIN {
|
||||
use strict;
|
||||
use warnings FATAL => 'all';
|
||||
use English qw(-no_match_vars);
|
||||
use Test::More tests => 5;
|
||||
use Test::More;
|
||||
|
||||
use PerconaTest;
|
||||
shift @INC; # These two shifts are required for tools that use base and
|
||||
@@ -68,7 +68,18 @@ ok(
|
||||
"--ignore-rules"
|
||||
);
|
||||
|
||||
my ($output) = full_output(sub {
|
||||
pt_variable_advisor::main(@args,
|
||||
'--source-of-variables', "$sample/vars-baron-002.txt"
|
||||
)});
|
||||
|
||||
like(
|
||||
$output,
|
||||
qr/\Qdual-master or ring replication configuration?\E$/sm,
|
||||
"Sentences are delimited by . or ?"
|
||||
);
|
||||
|
||||
# #############################################################################
|
||||
# Done.
|
||||
# #############################################################################
|
||||
exit;
|
||||
done_testing;
|
||||
|
Reference in New Issue
Block a user