Enhances Reflux Test Coverage With #31
Merged
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.
TLDR;
Adds tests to specifically target and eliminate surviving mutations identified during mutation testing (https://dartmutant.dev) of the reflux library, focusing on selectors, store subscriptions, time travel enhancer, and composed enhancers.
What Does This Do?
This pull request enhances the robustness of the reflux library by adding targeted tests that specifically address mutations that survived the initial mutation testing process. These tests ensure that the core functionalities of reflux, such as selectors, store subscriptions, time travel, and enhancer composition, behave as expected under various edge cases and input conditions, thereby improving the overall reliability and correctness of the library.
Brief Details?
mutation_killer_test.dart, which includes focused tests for specific mutations across different components.selector_memoization_test.dartto include tests for null input handling in selectors, addressing scenarios where initial caching might lead to incorrect results.selectors_test.dartandstore_test.dartto improve coverage and address potential mutation issues.store_edge_cases_test.dartHow Do The Tests Prove The Change Works?
The tests in
mutation_killer_test.dartare designed to directly target and kill specific mutations:createSelector3,createSelector4,createSelector5,ResettableSelector.create1, andResettableSelector.create2ensure correct computation even when initial inputs are null, preventing unintended caching of null results.Storeensure that double unsubscriptions do not inadvertently remove other listeners and that theisSubscribedflag is correctly managed.TimeTravelEnhancerverify correct history truncation and state management when jumping between states.composeEnhancersconfirm that enhancers are composed and applied correctly, even with empty or single enhancer lists.The tests in
selector_memoization_test.dartfurther validate correct selector behavior with null inputs and after cache resets.