mirror of
https://github.com/nlohmann/json.git
synced 2026-11-07 00:05:28 +00:00
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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N5NasEsrzHhSNouxSoEwqz
This commit is contained in:
@@ -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()) == ',');
|
||||
|
||||
Reference in New Issue
Block a user