-
Notifications
You must be signed in to change notification settings - Fork 83
Migrate debugger_test
and instance_test
to null-safety
#1708
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
Conversation
debugger_test
, inspector_test
, and instance_test
to null-safetydebugger_test
and instance_test
to null-safety
@@ -163,29 +161,4 @@ void main() async { | |||
expect(frames[3].kind, FrameKind.kAsyncSuspensionMarker); | |||
expect(frames[4].kind, FrameKind.kAsyncCausal); | |||
}); | |||
|
|||
group('errors', () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed because all this was checking was whether an error would be thrown if a null value was passed as a parameter (when a null value wasn't expected). With null-safety, this isn't possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the idea was to test that the error message is shown, passing the null was just the way to trigger it. Is there any other way to trigger the errors in the debugger? Maybe throwing somewhere in the fake inspector code? Or by introducing a fake stack computer that throws when calculating frames?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added test back in, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Elliott! Left a comment about the test removal. Would be good to find a way to keep it.
@@ -163,29 +161,4 @@ void main() async { | |||
expect(frames[3].kind, FrameKind.kAsyncSuspensionMarker); | |||
expect(frames[4].kind, FrameKind.kAsyncCausal); | |||
}); | |||
|
|||
group('errors', () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the idea was to test that the error message is shown, passing the null was just the way to trigger it. Is there any other way to trigger the errors in the debugger? Maybe throwing somewhere in the fake inspector code? Or by introducing a fake stack computer that throws when calculating frames?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
I did not refactor away the null-assert
!
s added by the Dart migration tool. Because this is a test, the null-assert!
s should catch any regressions if something we expect to be non-null returns null.