Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate the tests of flutter_test to null-safety #67058

Merged
merged 2 commits into from Oct 1, 2020

Conversation

@goderbauer
Copy link
Member

@goderbauer goderbauer commented Oct 1, 2020

Description

Migrates the tests of flutter_test to null-safety. With that, the package is fully migrated.

Related Issues

Follow-up to #53908.

Tests

The PR only contains tests.

Checklist

Before you create this PR, confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Did any tests fail when you ran them? Please read Handling breaking changes.


void main() {
test('$WidgetsBinding initializes with $AutomatedTestWidgetsFlutterBinding when FLUTTER_TEST is defined but null', () {
TestWidgetsFlutterBinding.ensureInitialized(<String, String>{'FLUTTER_TEST': null});
Copy link
Member Author

@goderbauer goderbauer Oct 1, 2020

This test is deleted because the type system now grantees that null can never be passed in as a value.

@goderbauer goderbauer requested a review from dnfield Oct 1, 2020
dnfield
dnfield approved these changes Oct 1, 2020
Copy link
Member

@dnfield dnfield left a comment

LGTM with some whitespace nits

return Container(
padding: const EdgeInsets.all(8.0),
color: background,
child: Icon(icon, color: color),
);
}

Widget _text ({String text = 'Text', Color color, Color background}) {
Widget _text ({String text = 'Text', required Color color, required Color background}) {
Copy link
Member

@dnfield dnfield Oct 1, 2020

Suggested change
Widget _text ({String text = 'Text', required Color color, required Color background}) {
Widget _text({String text = 'Text', required Color color, required Color background}) {

_icon (color: Colors.white, background: Colors.red[800]!, icon: Icons.more_horiz),
_icon (color: Colors.white, background: Colors.green[800]!, icon: Icons.description),
_icon (color: Colors.white, background: Colors.blue[800]!, icon: Icons.image),
_icon (color: Colors.white, background: Colors.purple[800]!, icon: Icons.beach_access),
Copy link
Member

@dnfield dnfield Oct 1, 2020

Suggested change
_icon (color: Colors.white, background: Colors.red[800]!, icon: Icons.more_horiz),
_icon (color: Colors.white, background: Colors.green[800]!, icon: Icons.description),
_icon (color: Colors.white, background: Colors.blue[800]!, icon: Icons.image),
_icon (color: Colors.white, background: Colors.purple[800]!, icon: Icons.beach_access),
_icon(color: Colors.white, background: Colors.red[800]!, icon: Icons.more_horiz),
_icon(color: Colors.white, background: Colors.green[800]!, icon: Icons.description),
_icon(color: Colors.white, background: Colors.blue[800]!, icon: Icons.image),
_icon(color: Colors.white, background: Colors.purple[800]!, icon: Icons.beach_access),

_icon (color: Colors.white, background: Colors.red[200]!, icon: Icons.more_horiz),
_icon (color: Colors.white, background: Colors.green[400]!, icon: Icons.description),
_icon (color: Colors.white, background: Colors.blue[600]!, icon: Icons.image),
_icon (color: Colors.white, background: Colors.purple[800]!, icon: Icons.beach_access),
Copy link
Member

@dnfield dnfield Oct 1, 2020

Suggested change
_icon (color: Colors.white, background: Colors.red[200]!, icon: Icons.more_horiz),
_icon (color: Colors.white, background: Colors.green[400]!, icon: Icons.description),
_icon (color: Colors.white, background: Colors.blue[600]!, icon: Icons.image),
_icon (color: Colors.white, background: Colors.purple[800]!, icon: Icons.beach_access),
_icon(color: Colors.white, background: Colors.red[200]!, icon: Icons.more_horiz),
_icon(color: Colors.white, background: Colors.green[400]!, icon: Icons.description),
_icon(color: Colors.white, background: Colors.blue[600]!, icon: Icons.image),
_icon(color: Colors.white, background: Colors.purple[800]!, icon: Icons.beach_access),

@fluttergithubbot fluttergithubbot merged commit cba170f into flutter:master Oct 1, 2020
33 checks passed
33 checks passed
@flutter-github-sync
Google testing Google testing passed!
Details
@flutter-dashboard[bot]
Linux analyze
Details
@flutter-dashboard[bot]
Linux build_tests
Details
@flutter-dashboard[bot]
Linux customer_testing
Details
@flutter-dashboard[bot]
Linux docs
Details
@flutter-dashboard[bot]
Linux firebase_abstract_method_smoke_test
Details
@flutter-dashboard[bot]
Linux firebase_android_embedding_v2_smoke_test
Details
@flutter-dashboard[bot]
Linux firebase_release_smoke_test
Details
@flutter-dashboard[bot]
Linux framework_tests
Details
@flutter-dashboard[bot]
Linux fuchsia_precache
Details
@flutter-dashboard[bot]
Linux gradle_r8_test
Details
@flutter-dashboard[bot]
Linux web_integration_tests
Details
@flutter-dashboard[bot]
Linux web_smoke_test
Details
@flutter-dashboard[bot]
Linux web_tests
Details
@flutter-dashboard[bot]
Mac customer_testing
Details
@flutter-dashboard[bot]
Mac framework_tests
Details
@wip[bot]
WIP Ready for review
Details
@flutter-dashboard[bot]
Windows customer_testing
Details
@flutter-dashboard[bot]
Windows framework_tests
Details
@flutter-dashboard[bot]
Windows tool_tests
Details
@cirrus-ci[bot]
analyze-linux Task Summary
Details
@googlebot
cla/google All necessary CLAs are signed
@cirrus-ci[bot]
customer_testing-linux Task Summary
Details
@cirrus-ci[bot]
deploy_gallery-linux Task Summary
Details
@cirrus-ci[bot]
deploy_gallery-macos Task Summary
Details
@cirrus-ci[bot]
docs-linux Task Summary
Details
@flutter-dashboard[bot]
flutter-build
Details
@flutter-dashboard[bot]
flutter-gold All golden file tests have passed.
Details
@cirrus-ci[bot]
framework_tests-libraries-linux Task Summary
Details
@cirrus-ci[bot]
framework_tests-misc-linux Task Summary
Details
@cirrus-ci[bot]
framework_tests-widgets-linux Task Summary
Details
@cirrus-ci[bot]
web_integration_tests Task Summary
Details
@cirrus-ci[bot]
web_smoke_test Task Summary
Details
@goderbauer goderbauer deleted the testmigration branch Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants