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

Commit89162b7

Browse files
committed
Tighten up Windows CRLF conversion in our TAP test scripts.
Back-patch commits91bdf49 andffb4cee, so that all branchesagree on when and how to do Windows CRLF conversion.This should close the referenced thread. Thanks to Andrew Dunstanfor discussion/review.Discussion:https://postgr.es/m/412ae8da-76bb-640f-039a-f3513499e53d@gmx.net
1 parent90b418f commit89162b7

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

‎src/bin/pg_rewind/t/RewindTest.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ sub check_query
113113
}
114114
else
115115
{
116-
$stdout =~s/\r//gif$Config{osname}eq'msys';
116+
$stdout =~s/\r\n/\n/gif$Config{osname}eq'msys';
117117
is($stdout,$expected_stdout,"$test_name: query result matches");
118118
}
119119
return;

‎src/test/perl/PostgresNode.pm

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,7 +1247,6 @@ sub safe_psql
12471247
print"\n#### End standard error\n";
12481248
}
12491249

1250-
$stdout =~s/\r//gif$TestLib::windows_os;
12511250
return$stdout;
12521251
}
12531252

@@ -1423,16 +1422,20 @@ sub psql
14231422
}
14241423
};
14251424

1425+
# Note: on Windows, IPC::Run seems to convert \r\n to \n in program output
1426+
# if we're using native Perl, but not if we're using MSys Perl. So do it
1427+
# by hand in the latter case, here and elsewhere.
1428+
14261429
if (defined$$stdout)
14271430
{
1431+
$$stdout =~s/\r\n/\n/gif$Config{osname}eq'msys';
14281432
chomp$$stdout;
1429-
$$stdout =~s/\r//gif$TestLib::windows_os;
14301433
}
14311434

14321435
if (defined$$stderr)
14331436
{
1437+
$$stderr =~s/\r\n/\n/gif$Config{osname}eq'msys';
14341438
chomp$$stderr;
1435-
$$stderr =~s/\r//gif$TestLib::windows_os;
14361439
}
14371440

14381441
# See http://perldoc.perl.org/perlvar.html#%24CHILD_ERROR
@@ -1495,8 +1498,8 @@ sub poll_query_until
14951498
{
14961499
my$result = IPC::Run::run$cmd,'>', \$stdout,'2>', \$stderr;
14971500

1501+
$stdout =~s/\r\n/\n/gif$Config{osname}eq'msys';
14981502
chomp($stdout);
1499-
$stdout =~s/\r//gif$TestLib::windows_os;
15001503

15011504
if ($stdouteq$expected)
15021505
{
@@ -1511,8 +1514,8 @@ sub poll_query_until
15111514

15121515
# The query result didn't change in 180 seconds. Give up. Print the
15131516
# output from the last attempt, hopefully that's useful for debugging.
1517+
$stderr =~s/\r\n/\n/gif$Config{osname}eq'msys';
15141518
chomp($stderr);
1515-
$stderr =~s/\r//gif$TestLib::windows_os;
15161519
diagqq(poll_query_until timed out executing this query:
15171520
$query
15181521
expecting this output:
@@ -1946,8 +1949,8 @@ sub pg_recvlogical_upto
19461949
}
19471950
};
19481951

1949-
$stdout =~s/\r//gif$TestLib::windows_os;
1950-
$stderr =~s/\r//gif$TestLib::windows_os;
1952+
$stdout =~s/\r\n/\n/gif$Config{osname}eq'msys';
1953+
$stderr =~s/\r\n/\n/gif$Config{osname}eq'msys';
19511954

19521955
if (wantarray)
19531956
{

‎src/test/perl/TestLib.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ sub slurp_file
254254
ordie"could not read\"$filename\":$!";
255255
my$contents = <$in>;
256256
close$in;
257-
$contents =~s/\r//gif$Config{osname}eq'msys';
257+
$contents =~s/\r\n/\n/gif$Config{osname}eq'msys';
258258
return$contents;
259259
}
260260

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp