| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library test.integration.analysis; | 5 library test.integration.analysis; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection'; | 8 import 'dart:collection'; |
| 9 import 'dart:convert'; | 9 import 'dart:convert'; |
| 10 import 'dart:io'; | 10 import 'dart:io'; |
| 11 | 11 |
| 12 import 'package:analysis_server/plugin/protocol/protocol.dart'; | 12 import 'package:analysis_server/plugin/protocol/protocol.dart'; |
| 13 import 'package:analysis_server/src/constants.dart'; | 13 import 'package:analysis_server/src/constants.dart'; |
| 14 import 'package:path/path.dart'; | 14 import 'package:path/path.dart'; |
| 15 import 'package:unittest/unittest.dart'; | 15 import 'package:unittest/unittest.dart'; |
| 16 | 16 |
| 17 import 'integration_test_methods.dart'; | 17 import 'integration_test_methods.dart'; |
| 18 import 'protocol_matchers.dart'; | 18 import 'protocol_matchers.dart'; |
| 19 | 19 |
| 20 const Matcher isBool = const isInstanceOf<bool>('bool'); | 20 const Matcher isBool = const isInstanceOf<bool>(); |
| 21 | 21 |
| 22 const Matcher isInt = const isInstanceOf<int>('int'); | 22 const Matcher isInt = const isInstanceOf<int>(); |
| 23 | 23 |
| 24 const Matcher isNotification = const MatchesJsonObject( | 24 const Matcher isNotification = const MatchesJsonObject( |
| 25 'notification', const {'event': isString}, | 25 'notification', const {'event': isString}, |
| 26 optionalFields: const {'params': isMap}); | 26 optionalFields: const {'params': isMap}); |
| 27 | 27 |
| 28 const Matcher isObject = isMap; | 28 const Matcher isObject = isMap; |
| 29 | 29 |
| 30 const Matcher isString = const isInstanceOf<String>('String'); | 30 const Matcher isString = const isInstanceOf<String>(); |
| 31 | 31 |
| 32 final Matcher isResponse = new MatchesJsonObject('response', {'id': isString}, | 32 final Matcher isResponse = new MatchesJsonObject('response', {'id': isString}, |
| 33 optionalFields: {'result': anything, 'error': isRequestError}); | 33 optionalFields: {'result': anything, 'error': isRequestError}); |
| 34 | 34 |
| 35 Matcher isListOf(Matcher elementMatcher) => new _ListOf(elementMatcher); | 35 Matcher isListOf(Matcher elementMatcher) => new _ListOf(elementMatcher); |
| 36 | 36 |
| 37 Matcher isMapOf(Matcher keyMatcher, Matcher valueMatcher) => | 37 Matcher isMapOf(Matcher keyMatcher, Matcher valueMatcher) => |
| 38 new _MapOf(keyMatcher, valueMatcher); | 38 new _MapOf(keyMatcher, valueMatcher); |
| 39 | 39 |
| 40 Matcher isOneOf(List<Matcher> choiceMatchers) => new _OneOf(choiceMatchers); | 40 Matcher isOneOf(List<Matcher> choiceMatchers) => new _OneOf(choiceMatchers); |
| (...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 886 void populateMismatches(item, List<MismatchDescriber> mismatches); | 886 void populateMismatches(item, List<MismatchDescriber> mismatches); |
| 887 | 887 |
| 888 /** | 888 /** |
| 889 * Create a [MismatchDescriber] describing a mismatch with a simple string. | 889 * Create a [MismatchDescriber] describing a mismatch with a simple string. |
| 890 */ | 890 */ |
| 891 MismatchDescriber simpleDescription(String description) => | 891 MismatchDescriber simpleDescription(String description) => |
| 892 (Description mismatchDescription) { | 892 (Description mismatchDescription) { |
| 893 mismatchDescription.add(description); | 893 mismatchDescription.add(description); |
| 894 }; | 894 }; |
| 895 } | 895 } |
| OLD | NEW |