Fix issue with fuzz test

Previously an implementation could never call on_begin_number or
on_end_number and still pass
This commit is contained in:
2025-05-19 15:58:15 -04:00
parent 2cb9bc8ad2
commit be8187b2fd
4 changed files with 111 additions and 107 deletions

View File

@@ -10,7 +10,6 @@
#include <simdjson.h>
#include "callbacks.h"
#include "minify.h"
#include "parser3.h"
// This is the JSON grammar in McKeeman Form.
@@ -147,9 +146,9 @@ const std::string json = R"({
})";
void testStreaming(std::string const &json) {
MinifyState streaming;
MinifyState batch;
auto c = minifyCallbacks();
SerializeState streaming;
SerializeState batch;
auto c = serializeCallbacks();
{
auto copy = json;
parser3::Parser3 parser(&c, &streaming);
@@ -170,8 +169,8 @@ void testStreaming(std::string const &json) {
} // namespace
TEST_CASE("parser3") {
Callbacks c = minifyCallbacks();
MinifyState state;
Callbacks c = serializeCallbacks();
SerializeState state;
{
auto copy = json;
parser3::Parser3 parser(&c, &state);