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/error/listener.dart'; | 9 import 'package:analyzer/error/listener.dart'; |
10 import 'package:analyzer/src/dart/scanner/reader.dart'; | 10 import 'package:analyzer/src/dart/scanner/reader.dart'; |
(...skipping 6003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6014 test_executable_param_name() { | 6014 test_executable_param_name() { |
6015 String text = 'f(x) {}'; | 6015 String text = 'f(x) {}'; |
6016 UnlinkedExecutable executable = serializeExecutableText(text); | 6016 UnlinkedExecutable executable = serializeExecutableText(text); |
6017 expect(executable.parameters, hasLength(1)); | 6017 expect(executable.parameters, hasLength(1)); |
6018 expect(executable.parameters[0].name, 'x'); | 6018 expect(executable.parameters[0].name, 'x'); |
6019 if (includeInformative) { | 6019 if (includeInformative) { |
6020 expect(executable.parameters[0].nameOffset, text.indexOf('x')); | 6020 expect(executable.parameters[0].nameOffset, text.indexOf('x')); |
6021 } | 6021 } |
6022 } | 6022 } |
6023 | 6023 |
| 6024 test_executable_param_isFinal() { |
| 6025 String text = 'f(x, final y) {}'; |
| 6026 UnlinkedExecutable executable = serializeExecutableText(text); |
| 6027 expect(executable.parameters, hasLength(2)); |
| 6028 expect(executable.parameters[0].name, 'x'); |
| 6029 expect(executable.parameters[0].isFinal, isFalse); |
| 6030 expect(executable.parameters[1].name, 'y'); |
| 6031 expect(executable.parameters[1].isFinal, isTrue); |
| 6032 } |
| 6033 |
6024 test_executable_param_no_flags() { | 6034 test_executable_param_no_flags() { |
6025 UnlinkedExecutable executable = serializeExecutableText('f(x) {}'); | 6035 UnlinkedExecutable executable = serializeExecutableText('f(x) {}'); |
6026 expect(executable.parameters[0].isFunctionTyped, isFalse); | 6036 expect(executable.parameters[0].isFunctionTyped, isFalse); |
6027 expect(executable.parameters[0].isInitializingFormal, isFalse); | 6037 expect(executable.parameters[0].isInitializingFormal, isFalse); |
6028 } | 6038 } |
6029 | 6039 |
6030 test_executable_param_non_function_typed() { | 6040 test_executable_param_non_function_typed() { |
6031 UnlinkedExecutable executable = serializeExecutableText('f(g) {}'); | 6041 UnlinkedExecutable executable = serializeExecutableText('f(g) {}'); |
6032 expect(executable.parameters[0].isFunctionTyped, isFalse); | 6042 expect(executable.parameters[0].isFunctionTyped, isFalse); |
6033 } | 6043 } |
(...skipping 4583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10617 class _PrefixExpectation { | 10627 class _PrefixExpectation { |
10618 final ReferenceKind kind; | 10628 final ReferenceKind kind; |
10619 final String name; | 10629 final String name; |
10620 final String absoluteUri; | 10630 final String absoluteUri; |
10621 final String relativeUri; | 10631 final String relativeUri; |
10622 final int numTypeParameters; | 10632 final int numTypeParameters; |
10623 | 10633 |
10624 _PrefixExpectation(this.kind, this.name, | 10634 _PrefixExpectation(this.kind, this.name, |
10625 {this.absoluteUri, this.relativeUri, this.numTypeParameters: 0}); | 10635 {this.absoluteUri, this.relativeUri, this.numTypeParameters: 0}); |
10626 } | 10636 } |
OLD | NEW |