Skip to content

Migrate a handful of tests to null-safety #1715

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

Merged
merged 3 commits into from
Aug 9, 2022

Conversation

elliette
Copy link
Contributor

@elliette elliette commented Aug 8, 2022

Migrates the following tests to null-safety:

    test/run_request_test.dart
    test/frontend_server_callstack_test.dart
    test/restore_breakpoints_test.dart
    test/variable_scope_test.dart
    test/frontend_server_breakpoint_test.dart
    test/reload_test.dart

@elliette elliette requested a review from annagrin August 8, 2022 19:55
Copy link
Contributor

@annagrin annagrin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with some comments.

});

test('set breakpoint', () async {
final line = await context.findBreakpointLine(
'printLocal', isolate.id, mainScript);
'printLocal', isolate.id!, mainScript);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we declare an isolateId variable instead of asserting on isolate.id!?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

final bp = await service.addBreakpointWithScriptUri(
isolate.id, mainScript.uri, line);
isolate.id!, mainScript.uri!, line);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe the same for mainScript.uri?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

});

tearDown(() async {
await service.resume(isolate.id);
await service.resume(isolate.id!);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar for isolate.id here, as it looks like it is used in many places.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

expect(
instance,
isA<Instance>().having(
(instance) => instance.classRef.name,
(instance) => instance.classRef!.name,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should add an expectation of the variableName being non-null here as well, WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@elliette elliette merged commit 614c732 into dart-lang:master Aug 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants