OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 analyzer.test.src.summary.summary_common; | 5 library analyzer.test.src.summary.summary_common; |
6 | 6 |
7 import 'package:analyzer/analyzer.dart'; | 7 import 'package:analyzer/analyzer.dart'; |
8 import 'package:analyzer/dart/ast/ast.dart'; | 8 import 'package:analyzer/dart/ast/ast.dart'; |
9 import 'package:analyzer/dart/element/element.dart'; | 9 import 'package:analyzer/dart/element/element.dart'; |
10 import 'package:analyzer/src/dart/scanner/reader.dart'; | 10 import 'package:analyzer/src/dart/scanner/reader.dart'; |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 UnlinkedDocumentationComment documentationComment, String text) { | 279 UnlinkedDocumentationComment documentationComment, String text) { |
280 expect(documentationComment, isNotNull); | 280 expect(documentationComment, isNotNull); |
281 int commentStart = text.indexOf('/*'); | 281 int commentStart = text.indexOf('/*'); |
282 expect(commentStart, isNot(-1)); | 282 expect(commentStart, isNot(-1)); |
283 int commentEnd = text.indexOf('*/'); | 283 int commentEnd = text.indexOf('*/'); |
284 expect(commentEnd, isNot(-1)); | 284 expect(commentEnd, isNot(-1)); |
285 commentEnd += 2; | 285 commentEnd += 2; |
286 String expectedCommentText = | 286 String expectedCommentText = |
287 text.substring(commentStart, commentEnd).replaceAll('\r\n', '\n'); | 287 text.substring(commentStart, commentEnd).replaceAll('\r\n', '\n'); |
288 expect(documentationComment.text, expectedCommentText); | 288 expect(documentationComment.text, expectedCommentText); |
| 289 expect(documentationComment.offset, commentStart); |
| 290 expect(documentationComment.length, commentEnd - commentStart); |
289 } | 291 } |
290 | 292 |
291 /** | 293 /** |
292 * Verify that the given [typeRef] represents the type `dynamic`. | 294 * Verify that the given [typeRef] represents the type `dynamic`. |
293 */ | 295 */ |
294 void checkDynamicTypeRef(EntityRef typeRef) { | 296 void checkDynamicTypeRef(EntityRef typeRef) { |
295 checkTypeRef(typeRef, null, null, 'dynamic'); | 297 checkTypeRef(typeRef, null, null, 'dynamic'); |
296 } | 298 } |
297 | 299 |
298 /** | 300 /** |
(...skipping 10188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10487 class _PrefixExpectation { | 10489 class _PrefixExpectation { |
10488 final ReferenceKind kind; | 10490 final ReferenceKind kind; |
10489 final String name; | 10491 final String name; |
10490 final String absoluteUri; | 10492 final String absoluteUri; |
10491 final String relativeUri; | 10493 final String relativeUri; |
10492 final int numTypeParameters; | 10494 final int numTypeParameters; |
10493 | 10495 |
10494 _PrefixExpectation(this.kind, this.name, | 10496 _PrefixExpectation(this.kind, this.name, |
10495 {this.absoluteUri, this.relativeUri, this.numTypeParameters: 0}); | 10497 {this.absoluteUri, this.relativeUri, this.numTypeParameters: 0}); |
10496 } | 10498 } |
OLD | NEW |