Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(991)

Unified Diff: pkg/analysis_server/test/mocks.dart

Issue 402723003: first cut simple code completion results (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: address comments Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/analysis_server/test/mocks.dart
diff --git a/pkg/analysis_server/test/mocks.dart b/pkg/analysis_server/test/mocks.dart
index a27a3e2a4c1d8300c4a99b4a1f1271c802e42a70..917da7e29a9daa4fce0e0ce0d8d2a2ea3f0370dc 100644
--- a/pkg/analysis_server/test/mocks.dart
+++ b/pkg/analysis_server/test/mocks.dart
@@ -245,18 +245,22 @@ class _IsResponseSuccess extends Matcher {
@override
bool matches(item, Map matchState) {
Response response = item;
- return response.id == _id && response.error == null;
+ return response != null && response.id == _id && response.error == null;
}
@override
Description describeMismatch(item, Description mismatchDescription,
Map matchState, bool verbose) {
Response response = item;
- var id = response.id;
- RequestError error = response.error;
- mismatchDescription.add('has identifier "$id"');
- if (error != null) {
- mismatchDescription.add(' and has error $error');
+ if (response == null) {
+ mismatchDescription.add('is null response');
+ } else {
+ var id = response.id;
+ RequestError error = response.error;
+ mismatchDescription.add('has identifier "$id"');
+ if (error != null) {
+ mismatchDescription.add(' and has error $error');
+ }
}
return mismatchDescription;
}

Powered by Google App Engine
This is Rietveld 408576698