| 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.protocol; | 5 library test.protocol; |
| 6 | 6 |
| 7 import 'dart:convert'; | 7 import 'dart:convert'; |
| 8 | 8 |
| 9 import 'package:analysis_server/src/constants.dart'; | 9 import 'package:analysis_server/src/constants.dart'; |
| 10 import 'package:analysis_server/src/protocol.dart'; | 10 import 'package:analysis_server/src/protocol.dart'; |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 Response.ID: '', | 217 Response.ID: '', |
| 218 Response.ERROR: { | 218 Response.ERROR: { |
| 219 'code': 'INVALID_REQUEST', | 219 'code': 'INVALID_REQUEST', |
| 220 'message': 'Invalid request' | 220 'message': 'Invalid request' |
| 221 } | 221 } |
| 222 })); | 222 })); |
| 223 } | 223 } |
| 224 | 224 |
| 225 void test_create_unanalyzedPriorityFiles() { | 225 void test_create_unanalyzedPriorityFiles() { |
| 226 Response response = | 226 Response response = |
| 227 new Response.unanalyzedPriorityFiles(new Request('0', ''), 'file list'); | 227 new Response.unanalyzedPriorityFiles('0', 'file list'); |
| 228 expect(response.id, equals('0')); | 228 expect(response.id, equals('0')); |
| 229 expect(response.error, isNotNull); | 229 expect(response.error, isNotNull); |
| 230 expect(response.toJson(), equals({ | 230 expect(response.toJson(), equals({ |
| 231 Response.ID: '0', | 231 Response.ID: '0', |
| 232 Response.ERROR: { | 232 Response.ERROR: { |
| 233 'code': 'UNANALYZED_PRIORITY_FILES', | 233 'code': 'UNANALYZED_PRIORITY_FILES', |
| 234 'message': "Unanalyzed files cannot be a priority: 'file list'" | 234 'message': "Unanalyzed files cannot be a priority: 'file list'" |
| 235 } | 235 } |
| 236 })); | 236 })); |
| 237 } | 237 } |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 Response original = new Response('myId', result: { | 269 Response original = new Response('myId', result: { |
| 270 'foo': 'bar' | 270 'foo': 'bar' |
| 271 }); | 271 }); |
| 272 Response response = new Response.fromJson(original.toJson()); | 272 Response response = new Response.fromJson(original.toJson()); |
| 273 expect(response.id, equals('myId')); | 273 expect(response.id, equals('myId')); |
| 274 Map<String, Object> result = response.toJson()['result']; | 274 Map<String, Object> result = response.toJson()['result']; |
| 275 expect(result.length, equals(1)); | 275 expect(result.length, equals(1)); |
| 276 expect(result['foo'], equals('bar')); | 276 expect(result['foo'], equals('bar')); |
| 277 } | 277 } |
| 278 } | 278 } |
| OLD | NEW |