| 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 2985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2996 } | 2996 } |
| 2997 | 2997 |
| 2998 test_constructor() { | 2998 test_constructor() { |
| 2999 String text = 'class C { C(); }'; | 2999 String text = 'class C { C(); }'; |
| 3000 UnlinkedExecutable executable = | 3000 UnlinkedExecutable executable = |
| 3001 findExecutable('', executables: serializeClassText(text).executables); | 3001 findExecutable('', executables: serializeClassText(text).executables); |
| 3002 expect(executable.kind, UnlinkedExecutableKind.constructor); | 3002 expect(executable.kind, UnlinkedExecutableKind.constructor); |
| 3003 expect(executable.returnType, isNull); | 3003 expect(executable.returnType, isNull); |
| 3004 expect(executable.isExternal, isFalse); | 3004 expect(executable.isExternal, isFalse); |
| 3005 expect(executable.nameOffset, text.indexOf('C();')); | 3005 expect(executable.nameOffset, text.indexOf('C();')); |
| 3006 expect(executable.periodOffset, 0); |
| 3007 expect(executable.nameEnd, 0); |
| 3006 expect(executable.isRedirectedConstructor, isFalse); | 3008 expect(executable.isRedirectedConstructor, isFalse); |
| 3007 expect(executable.redirectedConstructor, isNull); | 3009 expect(executable.redirectedConstructor, isNull); |
| 3008 expect(executable.redirectedConstructorName, isEmpty); | 3010 expect(executable.redirectedConstructorName, isEmpty); |
| 3009 expect(executable.visibleOffset, 0); | 3011 expect(executable.visibleOffset, 0); |
| 3010 expect(executable.visibleLength, 0); | 3012 expect(executable.visibleLength, 0); |
| 3011 } | 3013 } |
| 3012 | 3014 |
| 3013 test_constructor_anonymous() { | 3015 test_constructor_anonymous() { |
| 3014 UnlinkedExecutable executable = findExecutable('', | 3016 UnlinkedExecutable executable = findExecutable('', |
| 3015 executables: serializeClassText('class C { C(); }').executables); | 3017 executables: serializeClassText('class C { C(); }').executables); |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3397 _assertUnlinkedConst(param.defaultValue, | 3399 _assertUnlinkedConst(param.defaultValue, |
| 3398 operators: [UnlinkedConstOperation.pushInt], ints: [42]); | 3400 operators: [UnlinkedConstOperation.pushInt], ints: [42]); |
| 3399 } | 3401 } |
| 3400 | 3402 |
| 3401 test_constructor_named() { | 3403 test_constructor_named() { |
| 3402 String text = 'class C { C.foo(); }'; | 3404 String text = 'class C { C.foo(); }'; |
| 3403 UnlinkedExecutable executable = findExecutable('foo', | 3405 UnlinkedExecutable executable = findExecutable('foo', |
| 3404 executables: serializeClassText(text).executables); | 3406 executables: serializeClassText(text).executables); |
| 3405 expect(executable.name, 'foo'); | 3407 expect(executable.name, 'foo'); |
| 3406 expect(executable.nameOffset, text.indexOf('foo')); | 3408 expect(executable.nameOffset, text.indexOf('foo')); |
| 3409 expect(executable.periodOffset, text.indexOf('.foo')); |
| 3410 expect(executable.nameEnd, text.indexOf('()')); |
| 3407 } | 3411 } |
| 3408 | 3412 |
| 3409 test_constructor_non_const() { | 3413 test_constructor_non_const() { |
| 3410 UnlinkedExecutable executable = findExecutable('', | 3414 UnlinkedExecutable executable = findExecutable('', |
| 3411 executables: serializeClassText('class C { C(); }').executables); | 3415 executables: serializeClassText('class C { C(); }').executables); |
| 3412 expect(executable.isConst, isFalse); | 3416 expect(executable.isConst, isFalse); |
| 3413 } | 3417 } |
| 3414 | 3418 |
| 3415 test_constructor_non_factory() { | 3419 test_constructor_non_factory() { |
| 3416 UnlinkedExecutable executable = findExecutable('', | 3420 UnlinkedExecutable executable = findExecutable('', |
| (...skipping 3883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7300 class _PrefixExpectation { | 7304 class _PrefixExpectation { |
| 7301 final ReferenceKind kind; | 7305 final ReferenceKind kind; |
| 7302 final String name; | 7306 final String name; |
| 7303 final String absoluteUri; | 7307 final String absoluteUri; |
| 7304 final String relativeUri; | 7308 final String relativeUri; |
| 7305 final int numTypeParameters; | 7309 final int numTypeParameters; |
| 7306 | 7310 |
| 7307 _PrefixExpectation(this.kind, this.name, | 7311 _PrefixExpectation(this.kind, this.name, |
| 7308 {this.absoluteUri, this.relativeUri, this.numTypeParameters: 0}); | 7312 {this.absoluteUri, this.relativeUri, this.numTypeParameters: 0}); |
| 7309 } | 7313 } |
| OLD | NEW |