forked from zulip/zulip-flutter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Use color checks that tolerate floating-point errors
Done to follow a draft migration guide: https://github.com/flutter/website/blob/997c893ccec5fb15dd085a4d23fe8c43870c631b/src/content/release/breaking-changes/wide-gamut-framework.md for the proposed breaking change that raised flutter/flutter#155113 In our case we also needed to use `package:flutter_checks` and `package:legacy_checks` to wrap the legacy `Matcher`s `isSameColorAs` and `isSameColorSwatchAs` from `package:flutter_test`; see discussion of those: flutter/flutter#155113 (comment) flutter/flutter#155113 (comment)
- Loading branch information
1 parent
90c7b26
commit cdbe141
Showing
10 changed files
with
80 additions
and
48 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import 'package:checks/checks.dart'; | ||
import 'package:flutter_test/flutter_test.dart' as flutter_matcher; | ||
import 'package:flutter/painting.dart'; | ||
import 'package:legacy_checks/legacy_checks.dart'; | ||
|
||
extension ColorSwatchChecks<T> on Subject<ColorSwatch<T>> { | ||
/// package:checks-style wrapper for [flutter_matcher.isSameColorSwatchAs]. | ||
void isSameColorSwatchAs(ColorSwatch<T> colorSwatch) { | ||
legacyMatcher(flutter_matcher.isSameColorSwatchAs(colorSwatch)); | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.