Add widget test framework with custom serializer to identify, validate, and regression test bugs #120
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.
Summary
The motivation is to create a comprehensive, flexible testing framework for validating the library's output - which is deterministic, but has to process potentially complex user inputs. It allows a more test driven approach to bugs where you create a test that validates the unexpected behavior, validates the fix, and then is moved in a passing state to regression to ensure the bug doesn't re-appear in the future.
It uses a custom serializer that converts rendered markdown into stable, comparable strings like
TEXT("bold")[bold]andUL_ITEM(TEXT("item")).What's Included
Infrastructure
test/utils/serializer.dart- Stable widget-to-string serializationtest/utils/test_helpers.dart-pumpMarkdown(),getSerializedOutput(),expectMarkdown()test/README.md- Full documentationTest Coverage (141 tests)
Bug Tracking Workflow
test/bugs/-> Known unfixed bugs (expected to fail)test/regression/-> Fixed bugs (expected to pass, prevent recurrence)Bugs Discovered
LinkButton.urlproperty not populated when links are created[text](url "title")not parsedBoth documented with failing tests in
test/bugs/. Tests are skipped allowing passing 'current state' run.Running Tests
All tests except known bugs
flutter test test/block test/inline test/latex test/images test/integration test/regression