[libcxx-commits] [libcxx] [libc++][format] Fixed `println.blank_line.sh.cpp` test on llvm-clang-win-x-* configurations (PR #88011)

Hristo Hristov via libcxx-commits libcxx-commits at lists.llvm.org
Mon Apr 8 09:31:57 PDT 2024


https://github.com/H-G-Hristov created https://github.com/llvm/llvm-project/pull/88011

Fix for issue: https://github.com/llvm/llvm-project/pull/87277#issuecomment-2041864530

>From 863475fd5426078df5d06d9880678fab1c790222 Mon Sep 17 00:00:00 2001
From: Hristo Hristov <hghristov.rmm at gmail.com>
Date: Mon, 8 Apr 2024 19:31:21 +0300
Subject: [PATCH] [libc++][format] Fixed `println.blank_line.sh.cpp` test on
 llvm-clang-win-x-* configurations

Fix for issue: https://github.com/llvm/llvm-project/pull/87277#issuecomment-2041864530
---
 .../iostream.format/print.fun/println.blank_line.sh.cpp       | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libcxx/test/std/input.output/iostream.format/print.fun/println.blank_line.sh.cpp b/libcxx/test/std/input.output/iostream.format/print.fun/println.blank_line.sh.cpp
index 93c3563d501b20..a262c287108a4c 100644
--- a/libcxx/test/std/input.output/iostream.format/print.fun/println.blank_line.sh.cpp
+++ b/libcxx/test/std/input.output/iostream.format/print.fun/println.blank_line.sh.cpp
@@ -35,13 +35,15 @@
 
 // FILE_DEPENDENCIES: echo.sh
 // RUN: %{build}
-// RUN: %{exec} bash echo.sh -ne "\n" > %t.expected
+// RUN: %{exec} bash echo.sh -ne "println blank line test: \n" > %t.expected
 // RUN: %{exec} "%t.exe" > %t.actual
 // RUN: diff -u %t.actual %t.expected
 
 #include <print>
 
 int main(int, char**) {
+  // On some configurations the `diff -u` test fails if we print a single blank line character `\n`, so we print some text first.
+  std::print("println blank line test: ");
   std::println();
 
   return 0;



More information about the libcxx-commits mailing list