Compare commits

..
Author SHA1 Message Date
Niels Lohmann 2f89912064 Fix VS 2015 build of unit-bon8: compare tellg() outside doctest decomposition
VS 2015 cannot find an operator== for doctest's Expression_lhs<std::fpos>
and int, introduced in #6119. Evaluate the comparison as a plain bool.

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2026-11-14 22:06:37 +01:00
+1 -1
View File
@@ -622,7 +622,7 @@ TEST_CASE("BON8")
// with a terminated string, strict = false leaves the next value in the stream // with a terminated string, strict = false leaves the next value in the stream
std::istringstream terminated(std::string("\x61\xFF\x90", 3)); std::istringstream terminated(std::string("\x61\xFF\x90", 3));
CHECK(json::from_bon8(terminated, false) == "a"); CHECK(json::from_bon8(terminated, false) == "a");
CHECK(terminated.tellg() == 2); CHECK((terminated.tellg() == 2));
CHECK(json::from_bon8(terminated, false) == 0); CHECK(json::from_bon8(terminated, false) == 0);
// without the terminator, the next value would be lost // without the terminator, the next value would be lost