[libcxx-commits] [libcxx] [llvm] [libc++] Fix checks for terminal and flushes in std::print() (PR #70321)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Wed Mar 11 02:53:16 PDT 2026


================
@@ -62,40 +61,19 @@ static void test_basics() {
   FILE* file = std::fopen(filename.c_str(), "wb");
   assert(file);
 
-  // Test writing to a "non-terminal" stream does not call WriteConsoleW.
-  std::__print::__vprint_unicode_windows(file, "Hello", std::make_format_args(), false, false);
-  assert(std::ftell(file) == 5);
-
-  // It's not possible to reliably test whether writing to a "terminal" stream
-  // flushes before writing. Testing flushing a closed stream worked on some
-  // platforms, but was unreliable.
----------------
philnik777 wrote:

AH, right, the preconditions changed.

https://github.com/llvm/llvm-project/pull/70321


More information about the libcxx-commits mailing list