Merge branch 'ab/align-perf-descriptions'

Output from perf tests have been updated to align their titles.

* ab/align-perf-descriptions:
  t/perf: correctly align non-ASCII descriptions in output
This commit is contained in:
Junio C Hamano 2017-05-01 14:14:42 +09:00
Родитель b439747bc1 db7ed0f20c
Коммит d9dfed9e47
2 изменённых файлов: 5 добавлений и 0 удалений

Просмотреть файл

@ -88,6 +88,7 @@ for my $t (@tests) {
sub read_descr { sub read_descr {
my $name = shift; my $name = shift;
open my $fh, "<", $name or return "<error reading description>"; open my $fh, "<", $name or return "<error reading description>";
binmode $fh, ":utf8" or die "PANIC on binmode: $!";
my $line = <$fh>; my $line = <$fh>;
close $fh or die "cannot close $name"; close $fh or die "cannot close $name";
chomp $line; chomp $line;
@ -147,6 +148,8 @@ for my $t (@subtests) {
my $totalwidth = 3*@dirs+$descrlen; my $totalwidth = 3*@dirs+$descrlen;
$totalwidth += $_ for (@colwidth); $totalwidth += $_ for (@colwidth);
binmode STDOUT, ":utf8" or die "PANIC on binmode: $!";
printf "%-${descrlen}s", "Test"; printf "%-${descrlen}s", "Test";
for my $i (0..$#dirs) { for my $i (0..$#dirs) {
my $d = $dirs[$i]; my $d = $dirs[$i];

Просмотреть файл

@ -33,6 +33,8 @@ test_perf 'export a weird var' '
test_export bar test_export bar
' '
test_perf 'éḿíẗ ńöń-ÁŚĆÍÍ ćḧáŕáćẗéŕś' 'true'
test_expect_success 'test_export works with weird vars' ' test_expect_success 'test_export works with weird vars' '
echo "$bar" && echo "$bar" &&
test "$bar" = "weird # variable" test "$bar" = "weird # variable"