| 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.analysis.notification.outline; | 5 library test.analysis.notification.outline; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 expect(location.offset, testCode.indexOf("B(int p);")); | 249 expect(location.offset, testCode.indexOf("B(int p);")); |
| 250 expect(location.length, "B".length); | 250 expect(location.length, "B".length); |
| 251 } | 251 } |
| 252 expect(element.parameters, "(int p)"); | 252 expect(element.parameters, "(int p)"); |
| 253 expect(element.returnType, isNull); | 253 expect(element.returnType, isNull); |
| 254 } | 254 } |
| 255 } | 255 } |
| 256 }); | 256 }); |
| 257 } | 257 } |
| 258 | 258 |
| 259 /** |
| 260 * Code like this caused NPE in the past. |
| 261 * |
| 262 * https://code.google.com/p/dart/issues/detail?id=21373 |
| 263 */ |
| 264 test_invalidGetterInConstructor() { |
| 265 addTestFile(''' |
| 266 class A { |
| 267 A() { |
| 268 get badGetter { |
| 269 const int CONST = 0; |
| 270 } |
| 271 } |
| 272 } |
| 273 '''); |
| 274 return prepareOutline().then((_) { |
| 275 expect(outline, isNotNull); |
| 276 }); |
| 277 } |
| 278 |
| 259 test_localFunctions() { | 279 test_localFunctions() { |
| 260 addTestFile(''' | 280 addTestFile(''' |
| 261 class A { | 281 class A { |
| 262 A() { | 282 A() { |
| 263 int local_A() {} | 283 int local_A() {} |
| 264 } | 284 } |
| 265 m() { | 285 m() { |
| 266 local_m() {} | 286 local_m() {} |
| 267 } | 287 } |
| 268 } | 288 } |
| (...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 734 Location location = element.location; | 754 Location location = element.location; |
| 735 expect(location.offset, testCode.indexOf("propB(int v) {}")); | 755 expect(location.offset, testCode.indexOf("propB(int v) {}")); |
| 736 expect(location.length, "propB".length); | 756 expect(location.length, "propB".length); |
| 737 } | 757 } |
| 738 expect(element.parameters, "(int v)"); | 758 expect(element.parameters, "(int v)"); |
| 739 expect(element.returnType, ""); | 759 expect(element.returnType, ""); |
| 740 } | 760 } |
| 741 }); | 761 }); |
| 742 } | 762 } |
| 743 } | 763 } |
| OLD | NEW |