Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitffb69b2

Browse files
committed
Add test for checking the line length of --help output
There was some discussion what the line length should be. Most outputcurrently clearly targets around 80 columns, but the maximum in usecurrently is 95, so we set that as the current maximum. This justensures that there is some guidance and there are no wild deviations.based on patch by Atsushi Torikoshi <torikoshia@oss.nttdata.com>Discussion:https://www.postgresql.org/message-id/flat/50ca8ff35a8dd8f9ec89963b503571a7@oss.nttdata.com
1 parentb433651 commitffb69b2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

‎src/test/perl/PostgreSQL/Test/Utils.pm

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -884,6 +884,15 @@ sub program_help_ok
884884
ok($result,"$cmd --help exit code 0");
885885
isnt($stdout,'',"$cmd --help goes to stdout");
886886
is($stderr,'',"$cmd --help nothing to stderr");
887+
888+
# This value isn't set in stone, it reflects the current
889+
# convention in use. Most output actually tries to aim for 80.
890+
my$max_line_length = 95;
891+
my@long_lines =grep {length >$max_line_length }split /\n/,$stdout;
892+
is(scalar@long_lines, 0,"$cmd --help maximum line length")
893+
or diag("These lines are too long (>$max_line_length):\n",
894+
join("\n",@long_lines));
895+
887896
return;
888897
}
889898

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp