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); | |
291 } | 289 } |
292 | 290 |
293 /** | 291 /** |
294 * Verify that the given [typeRef] represents the type `dynamic`. | 292 * Verify that the given [typeRef] represents the type `dynamic`. |
295 */ | 293 */ |
296 void checkDynamicTypeRef(EntityRef typeRef) { | 294 void checkDynamicTypeRef(EntityRef typeRef) { |
297 checkTypeRef(typeRef, null, null, 'dynamic'); | 295 checkTypeRef(typeRef, null, null, 'dynamic'); |
298 } | 296 } |
299 | 297 |
300 /** | 298 /** |
(...skipping 10188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10489 class _PrefixExpectation { | 10487 class _PrefixExpectation { |
10490 final ReferenceKind kind; | 10488 final ReferenceKind kind; |
10491 final String name; | 10489 final String name; |
10492 final String absoluteUri; | 10490 final String absoluteUri; |
10493 final String relativeUri; | 10491 final String relativeUri; |
10494 final int numTypeParameters; | 10492 final int numTypeParameters; |
10495 | 10493 |
10496 _PrefixExpectation(this.kind, this.name, | 10494 _PrefixExpectation(this.kind, this.name, |
10497 {this.absoluteUri, this.relativeUri, this.numTypeParameters: 0}); | 10495 {this.absoluteUri, this.relativeUri, this.numTypeParameters: 0}); |
10498 } | 10496 } |
OLD | NEW |