mirror of
https://github.com/nlohmann/json.git
synced 2026-11-09 05:51:45 +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:
1 file changed
+4
-2
@@ -303,10 +303,12 @@ TEST_CASE("parsing from a FILE*")
|
|||||||
}
|
}
|
||||||
#endif
|
#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")
|
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]");
|
const file_ptr f = open_with(name, "2, 3]");
|
||||||
REQUIRE(f != nullptr);
|
REQUIRE(f != nullptr);
|
||||||
REQUIRE(std::ungetc(',', f.get()) == ',');
|
REQUIRE(std::ungetc(',', f.get()) == ',');
|
||||||
|
|||||||
Reference in new issue
Block a user