1
0
Fork 0
mirror of https://github.com/dragonflydb/dragonfly.git synced 2024-12-15 17:51:06 +00:00

chore(json): low level parsing function

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
This commit is contained in:
Roman Gershman 2022-06-21 21:09:00 +03:00 committed by Roman Gershman
parent 985188c8ad
commit 54444bf6ca

View file

@ -63,4 +63,18 @@ TEST_F(JsonTest, Query) {
out);
}
TEST_F(JsonTest, Errors) {
auto cb = [](json_errc err, const ser_context& contexts) { return false; };
json_decoder<json> decoder;
basic_json_parser<char> parser(basic_json_decode_options<char>{}, cb);
string_view input{"\000bla"};
parser.update(input.data(), input.size());
parser.parse_some(decoder);
parser.finish_parse(decoder);
parser.check_done();
EXPECT_FALSE(decoder.is_valid());
}
} // namespace dfly