-
Notifications
You must be signed in to change notification settings - Fork 86
Migrate extension_debugger_test
, dart_uri_test
, and location_test
to null-safety
#1703
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
@@ -153,7 +153,7 @@ class ExtensionDebugger implements RemoteDebugger { | |||
|
|||
@override | |||
void close() => _closed ??= () { | |||
_closeController.add(WipEvent({})); | |||
_closeController.add({}); |
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.
The content of this event does not matter, its existence is used to notify clients that the connection should be closed. Using a WipEvent
caused a type error, since WipEvent
expects non-null parameters.
dwds/test/location_test.dart
Outdated
@@ -189,9 +187,9 @@ class MockLoadStrategy implements LoadStrategy { | |||
|
|||
@override | |||
shelf.Handler get handler => | |||
(request) => (request.url.path == 'someDummyPath') | |||
(request) async => (request.url.path == 'someDummyPath') |
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.
Looks like MockLoadStrategy
is very similar to the FakeStrategy
in fakes.dart - should we unify this code?
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.
Good point, done!
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 few comments.
dwds/test/location_test.dart
Outdated
? shelf.Response.ok('some dummy response') | ||
: null; | ||
: shelf.Response.notFound('not found'); |
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.
moduleForServerPath returns a Future<String?> in the base interface - should we make it the same here, to flush any compilation 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.
Done, thanks!
@@ -164,7 +162,7 @@ void main() { | |||
|
|||
tearDownAll(() async { | |||
DartUri.clear(); | |||
await outputDir?.delete(recursive: true); | |||
await outputDir.delete(recursive: true); |
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.
Not sure if this matters but this will prevent retries if the creation of outputDir fails, but previously retries would be technically 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.
Leaving for now, we can update if needed
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! The remaining comment is optional - we might leave the outputDir as optional just to be safe or wait for the scenario I described in there to happen and fix it then.
No description provided.