From 840469a24f7887c5c56e283b3682e4abfd008899 Mon Sep 17 00:00:00 2001 From: Andrea Marco Sartori Date: Tue, 13 Jun 2023 22:13:58 +0200 Subject: [PATCH] Add parsing tests --- tests/Feature/ParsingTest.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/Feature/ParsingTest.php b/tests/Feature/ParsingTest.php index 5309962..63d9e96 100644 --- a/tests/Feature/ParsingTest.php +++ b/tests/Feature/ParsingTest.php @@ -1,6 +1,7 @@ toParseTo($parsed); })->with(Dataset::forParsing()); +it('parses with custom decoders', function (string $json, array $parsed) { + expect(JsonParser::parse($json)->decoder(new SimdjsonDecoder()))->toParseTo($parsed); +})->with(Dataset::forParsing()); + +it('parses a custom number of bytes', function (string $json, array $parsed) { + expect(JsonParser::parse($json)->bytes(1024))->toParseTo($parsed); +})->with(Dataset::forParsing()); + it('eager loads JSON into an array', function (string $json, array $parsed) { expect(JsonParser::parse($json)->toArray())->toBe($parsed); })->with(Dataset::forParsing());