test(yet_another_json_isolate): add full coverage test suite#1583
Open
spydon wants to merge 2 commits into
Open
test(yet_another_json_isolate): add full coverage test suite#1583spydon wants to merge 2 commits into
spydon wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Expands the test suite for
yet_another_json_isolatefrom 4 tests to a comprehensive suite covering all reachable code paths.Line coverage of
lib/src/_isolates_io.dartgoes from 49/63 to 59/63. The only remaining uncovered lines are theRemoteError(native error) branch in_handleRes, which is defensive code that is unreachable through the public API: it only fires when a non-boolmethod flag reaches the isolate, and the publicdecode/encodemethods always send[input, bool].Coverage added
initialize()and lazy first-call initialization, fordecodeandencode.FormatExceptionon invalid JSON,JsonUnsupportedObjectErroron non-encodable objects, and verification that the isolate stays usable after a decode or encode error.disposeon a lazily initialized isolate, and two isolates operating independently.Two
io-specific behaviors (debugNamegetter, and the double-initialize()assertion) live in a separate@TestOn('vm')file so the shared suite compiles and passes on both the VM and web (dart2js/chrome) targets.Verification
dart test(VM): all passdart test -p chrome(web): all passdart analyze: no issuesdart format: clean