diff options
| author | Michael Paquier <michael@paquier.xyz> | 2025-10-28 08:26:42 +0900 |
|---|---|---|
| committer | Michael Paquier <michael@paquier.xyz> | 2025-10-28 08:26:42 +0900 |
| commit | 8767b449a3a1e75626dfb08f24da54933171d4c5 (patch) | |
| tree | 5a153d79f2ae7dbaf371bb9816b6b53c8693e8b5 /src/interfaces | |
| parent | 123661427b974777ed00abcfa10443d0ca525b3c (diff) | |
Simplify newline handling in two TAP tests
Two tests are changed in this commit:
- libpq's 006_service
- ldap's 003_ldap_connection_param_lookup
CRLF translation is already handled by the text mode, so there should be
need for any specific logic. See also 1c6d4629394d, msys perl being one
case where the translation mattered.
Note: This is first applied on HEAD, and backpatch will follow once the
buildfarm has provided an opinion about this commit.
Author: Jacob Champion <jacob.champion@enterprisedb.com>
Co-authored-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Discussion: https://postgr.es/m/aPsh39bxwYKvUlAf@paquier.xyz
Backpatch-through: 13
Diffstat (limited to 'src/interfaces')
| -rw-r--r-- | src/interfaces/libpq/t/006_service.pl | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/interfaces/libpq/t/006_service.pl b/src/interfaces/libpq/t/006_service.pl index 797e6232b8f..29a70629b44 100644 --- a/src/interfaces/libpq/t/006_service.pl +++ b/src/interfaces/libpq/t/006_service.pl @@ -22,18 +22,14 @@ $dummy_node->init; my $td = PostgreSQL::Test::Utils::tempdir; -# Windows vs non-Windows: CRLF vs LF for the file's newline, relying on -# the fact that libpq uses fgets() when reading the lines of a service file. -my $newline = $windows_os ? "\r\n" : "\n"; - # Create the set of service files used in the tests. # File that includes a valid service name, and uses a decomposed connection # string for its contents, split on spaces. my $srvfile_valid = "$td/pg_service_valid.conf"; -append_to_file($srvfile_valid, "[my_srv]" . $newline); +append_to_file($srvfile_valid, "[my_srv]\n"); foreach my $param (split(/\s+/, $node->connstr)) { - append_to_file($srvfile_valid, $param . $newline); + append_to_file($srvfile_valid, $param . "\n"); } # File defined with no contents, used as default value for PGSERVICEFILE, @@ -51,14 +47,14 @@ my $srvfile_missing = "$td/pg_service_missing.conf"; my $srvfile_nested = "$td/pg_service_nested.conf"; copy($srvfile_valid, $srvfile_nested) or die "Could not copy $srvfile_valid to $srvfile_nested: $!"; -append_to_file($srvfile_nested, 'service=invalid_srv' . $newline); +append_to_file($srvfile_nested, "service=invalid_srv\n"); # Service file with nested "servicefile" defined. my $srvfile_nested_2 = "$td/pg_service_nested_2.conf"; copy($srvfile_valid, $srvfile_nested_2) or die "Could not copy $srvfile_valid to $srvfile_nested_2: $!"; append_to_file($srvfile_nested_2, - 'servicefile=' . $srvfile_default . $newline); + 'servicefile=' . $srvfile_default . "\n"); # Set the fallback directory lookup of the service file to the temporary # directory of this test. PGSYSCONFDIR is used if the service file |
