From 6a6744004c3ac63945c0dfb7286ffdf2a99f2b82 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 6 Nov 2026 22:35:01 +0000 Subject: [PATCH] Tests: limit the multi-character ungetc() test to glibc and Apple The Windows C runtime only supports one pushed-back character, which broke the Windows CI jobs. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01N5NasEsrzHhSNouxSoEwqz --- tests/src/unit-file_input.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/src/unit-file_input.cpp b/tests/src/unit-file_input.cpp index b2e99d80d..f74f23267 100644 --- a/tests/src/unit-file_input.cpp +++ b/tests/src/unit-file_input.cpp @@ -303,10 +303,12 @@ TEST_CASE("parsing from a FILE*") } #endif -#if !defined(JSON_NOEXCEPTION) + // the C standard guarantees only one pushed-back character (and the + // Windows C runtime fails further calls to ungetc()), so this is limited + // to the C libraries that keep them in a separate buffer +#if !defined(JSON_NOEXCEPTION) && ((defined(__GLIBC__) && !defined(__UCLIBC__)) || defined(__APPLE__)) SECTION("characters pushed back with ungetc() before parsing") { - // (glibc and Apple keep them in a separate buffer) const file_ptr f = open_with(name, "2, 3]"); REQUIRE(f != nullptr); REQUIRE(std::ungetc(',', f.get()) == ',');