π§ͺ [testing improvement] Add test for _lineBoxCache cache eviction - #13
Conversation
|
π Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a π emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Adds an edge case widget test in material_async_button_theme_test.dart to verify that AsyncButtonSpinner's line box cache stays capped at a maximum capacity of 16 entries and evicts the oldest entry when a 17th distinct text style is evaluated. Exposes debugLineBoxCache with @VisibleForTesting for inspection in tests. Co-authored-by: esenmx <43244505+esenmx@users.noreply.github.com>
Formats material_async_button_theme_test.dart with `dart format` to resolve CI format check failure and adds unit test for _lineBoxCache eviction when capacity exceeds 16 entries. Co-authored-by: esenmx <43244505+esenmx@users.noreply.github.com>
Type the @VisibleForTesting getter as Map<(TextStyle, TextDirection, TextScaler), double> instead of Map<Object, double>, removing the covariance trap and letting the test assert which entry is oldest via the record's fontSize. Move the test into its own 'AsyncButtonSpinner line box cache' group, reset the global cache in addTearDown so a failing assertion cannot leak entries into later tests, replace the tautological containsKey check with fontSize assertions, and assert promotion as keys.last == secondKey. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
fed0d13 to
c3c54b9
Compare
π― What:
Added a unit test for
_lineBoxCachecache eviction when more than 16 distinct text styles are processed byAsyncButtonSpinner/_ambientTextLineBox.π Coverage:
debugLineBoxCacheannotated with@visibleForTesting._lineBoxCacheto its maximum capacity of 16.β¨ Result:
Closes the testing gap for line box cache bounds and eviction in
lib/src/material_async_button_theme.dart. All tests pass cleanly and static analysis passes with zero issues.PR created automatically by Jules for task 6579964137937089745 started by @esenmx