diff --git a/src/test/modules/test_json_parser/t/003_test_semantic.pl b/src/test/modules/test_json_parser/t/003_test_semantic.pl index 74e0fa5bb18..b6553bbcddf 100644 --- a/src/test/modules/test_json_parser/t/003_test_semantic.pl +++ b/src/test/modules/test_json_parser/t/003_test_semantic.pl @@ -29,7 +29,9 @@ print $fh $stdout, "\n"; close($fh); -($stdout, $stderr) = run_command([ "diff", "-u", $fname, $test_out ]); +my @diffopts = ("-u"); +push(@diffopts, "--strip-trailing-cr") if $windows_os; +($stdout, $stderr) = run_command([ "diff", @diffopts, $fname, $test_out ]); is($stdout, "", "no output diff"); is($stderr, "", "no diff error"); diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c index 7e7ad256000..9ff0a2d65e2 100644 --- a/src/test/regress/pg_regress.c +++ b/src/test/regress/pg_regress.c @@ -65,8 +65,8 @@ static char *shellprog = SHELLPROG; const char *basic_diff_opts = ""; const char *pretty_diff_opts = "-U3"; #else -const char *basic_diff_opts = "-w"; -const char *pretty_diff_opts = "-w -U3"; +const char *basic_diff_opts = "--strip-trailing-cr"; +const char *pretty_diff_opts = "--strip-trailing-cr -U3"; #endif /* diff --git a/src/tools/pg_bsd_indent/t/001_pg_bsd_indent.pl b/src/tools/pg_bsd_indent/t/001_pg_bsd_indent.pl index 24a9e80fa01..9e23ab96161 100644 --- a/src/tools/pg_bsd_indent/t/001_pg_bsd_indent.pl +++ b/src/tools/pg_bsd_indent/t/001_pg_bsd_indent.pl @@ -26,6 +26,10 @@ program_version_ok('pg_bsd_indent'); # Any diffs in the generated files will be accumulated here. my $diffs_file = "test.diffs"; +# options used with diff +my @diffopts = ("-upd"); +push(@diffopts, "--strip-trailing-cr") if $windows_os; + # Copy support files to current dir, so *.pro files don't need to know path. while (my $file = glob("$src_dir/tests/*.list")) { @@ -45,7 +49,7 @@ while (my $test_src = glob("$src_dir/tests/*.0")) ], "pg_bsd_indent succeeds on $test"); # check result matches, adding any diff to $diffs_file - my $result = run_log([ 'diff', '-upd', "$test_src.stdout", "$test.out" ], + my $result = run_log([ 'diff', @diffopts, "$test_src.stdout", "$test.out" ], '>>', $diffs_file); ok($result, "pg_bsd_indent output matches for $test"); }