diff --git a/bin/pt-variable-advisor b/bin/pt-variable-advisor index fb23d538..4a767fc9 100755 --- a/bin/pt-variable-advisor +++ b/bin/pt-variable-advisor @@ -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 diff --git a/t/pt-variable-advisor/show_variables_static.t b/t/pt-variable-advisor/show_variables_static.t index 66fd776a..539ca2e1 100644 --- a/t/pt-variable-advisor/show_variables_static.t +++ b/t/pt-variable-advisor/show_variables_static.t @@ -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;