| 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 analyzer.test.generated.all_the_rest_test; | 5 library analyzer.test.generated.all_the_rest_test; |
| 6 | 6 |
| 7 import 'package:analyzer/dart/ast/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
| 8 import 'package:analyzer/dart/element/element.dart'; | 8 import 'package:analyzer/dart/element/element.dart'; |
| 9 import 'package:analyzer/dart/element/type.dart'; | 9 import 'package:analyzer/dart/element/type.dart'; |
| 10 import 'package:analyzer/file_system/physical_file_system.dart'; | 10 import 'package:analyzer/file_system/physical_file_system.dart'; |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 } | 375 } |
| 376 | 376 |
| 377 void test_metadata_visitDeclaredIdentifier() { | 377 void test_metadata_visitDeclaredIdentifier() { |
| 378 LocalVariableElement localVariableElement = | 378 LocalVariableElement localVariableElement = |
| 379 buildElementsForText('f() { for (@a var x in y) {} }') | 379 buildElementsForText('f() { for (@a var x in y) {} }') |
| 380 .functions[0] | 380 .functions[0] |
| 381 .localVariables[0]; | 381 .localVariables[0]; |
| 382 checkMetadata(localVariableElement); | 382 checkMetadata(localVariableElement); |
| 383 } | 383 } |
| 384 | 384 |
| 385 void test_metadata_visitDefaultFormalParameter_fieldFormalParameter() { |
| 386 ParameterElement parameterElement = |
| 387 buildElementsForText('class C { var x; C([@a this.x = null]); }') |
| 388 .types[0] |
| 389 .constructors[0] |
| 390 .parameters[0]; |
| 391 checkMetadata(parameterElement); |
| 392 } |
| 393 |
| 394 void |
| 395 test_metadata_visitDefaultFormalParameter_functionTypedFormalParameter() { |
| 396 ParameterElement parameterElement = |
| 397 buildElementsForText('f([@a g() = null]) {}').functions[0].parameters[ |
| 398 0]; |
| 399 checkMetadata(parameterElement); |
| 400 } |
| 401 |
| 402 void test_metadata_visitDefaultFormalParameter_simpleFormalParameter() { |
| 403 ParameterElement parameterElement = |
| 404 buildElementsForText('f([@a gx = null]) {}').functions[0].parameters[0]; |
| 405 checkMetadata(parameterElement); |
| 406 } |
| 407 |
| 385 void test_metadata_visitEnumDeclaration() { | 408 void test_metadata_visitEnumDeclaration() { |
| 386 ClassElement classElement = | 409 ClassElement classElement = |
| 387 buildElementsForText('@a enum E { v }').enums[0]; | 410 buildElementsForText('@a enum E { v }').enums[0]; |
| 388 checkMetadata(classElement); | 411 checkMetadata(classElement); |
| 389 } | 412 } |
| 390 | 413 |
| 391 void test_metadata_visitExportDirective() { | 414 void test_metadata_visitExportDirective() { |
| 392 buildElementsForText('@a export "foo.dart";'); | 415 buildElementsForText('@a export "foo.dart";'); |
| 393 expect(compilationUnit.directives[0], new isInstanceOf<ExportDirective>()); | 416 expect(compilationUnit.directives[0], new isInstanceOf<ExportDirective>()); |
| 394 ExportDirective exportDirective = compilationUnit.directives[0]; | 417 ExportDirective exportDirective = compilationUnit.directives[0]; |
| (...skipping 3642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4037 expect(UriKind.fromEncoding(0x70), same(UriKind.PACKAGE_URI)); | 4060 expect(UriKind.fromEncoding(0x70), same(UriKind.PACKAGE_URI)); |
| 4038 expect(UriKind.fromEncoding(0x58), same(null)); | 4061 expect(UriKind.fromEncoding(0x58), same(null)); |
| 4039 } | 4062 } |
| 4040 | 4063 |
| 4041 void test_getEncoding() { | 4064 void test_getEncoding() { |
| 4042 expect(UriKind.DART_URI.encoding, 0x64); | 4065 expect(UriKind.DART_URI.encoding, 0x64); |
| 4043 expect(UriKind.FILE_URI.encoding, 0x66); | 4066 expect(UriKind.FILE_URI.encoding, 0x66); |
| 4044 expect(UriKind.PACKAGE_URI.encoding, 0x70); | 4067 expect(UriKind.PACKAGE_URI.encoding, 0x70); |
| 4045 } | 4068 } |
| 4046 } | 4069 } |
| OLD | NEW |