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:
parent
985188c8ad
commit
54444bf6ca
1 changed files with 14 additions and 0 deletions
|
@ -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
|
Loading…
Reference in a new issue