| 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/ast/token.dart'; | 8 import 'package:analyzer/dart/ast/token.dart'; |
| 9 import 'package:analyzer/dart/element/element.dart'; | 9 import 'package:analyzer/dart/element/element.dart'; |
| 10 import 'package:analyzer/dart/element/type.dart'; | 10 import 'package:analyzer/dart/element/type.dart'; |
| 11 import 'package:analyzer/file_system/file_system.dart'; | 11 import 'package:analyzer/file_system/file_system.dart'; |
| 12 import 'package:analyzer/file_system/memory_file_system.dart'; |
| 12 import 'package:analyzer/file_system/physical_file_system.dart'; | 13 import 'package:analyzer/file_system/physical_file_system.dart'; |
| 13 import 'package:analyzer/src/dart/ast/ast.dart'; | 14 import 'package:analyzer/src/dart/ast/ast.dart'; |
| 14 import 'package:analyzer/src/dart/ast/utilities.dart' hide ConstantEvaluator; | 15 import 'package:analyzer/src/dart/ast/utilities.dart' hide ConstantEvaluator; |
| 15 import 'package:analyzer/src/dart/element/builder.dart'; | 16 import 'package:analyzer/src/dart/element/builder.dart'; |
| 16 import 'package:analyzer/src/dart/element/element.dart'; | 17 import 'package:analyzer/src/dart/element/element.dart'; |
| 17 import 'package:analyzer/src/dart/sdk/sdk.dart' hide SdkLibrariesReader; | 18 import 'package:analyzer/src/dart/sdk/sdk.dart' hide SdkLibrariesReader; |
| 18 import 'package:analyzer/src/generated/engine.dart'; | 19 import 'package:analyzer/src/generated/engine.dart'; |
| 19 import 'package:analyzer/src/generated/error.dart'; | 20 import 'package:analyzer/src/generated/error.dart'; |
| 20 import 'package:analyzer/src/generated/java_core.dart'; | 21 import 'package:analyzer/src/generated/java_core.dart'; |
| 21 import 'package:analyzer/src/generated/java_engine_io.dart'; | 22 import 'package:analyzer/src/generated/java_engine_io.dart'; |
| 22 import 'package:analyzer/src/generated/java_io.dart'; | 23 import 'package:analyzer/src/generated/java_io.dart'; |
| 23 import 'package:analyzer/src/generated/resolver.dart'; | 24 import 'package:analyzer/src/generated/resolver.dart'; |
| 24 import 'package:analyzer/src/generated/sdk.dart'; | 25 import 'package:analyzer/src/generated/sdk.dart'; |
| 25 import 'package:analyzer/src/generated/sdk_io.dart'; | 26 import 'package:analyzer/src/generated/sdk_io.dart'; |
| 26 import 'package:analyzer/src/generated/source.dart'; | 27 import 'package:analyzer/src/generated/source.dart'; |
| 27 import 'package:analyzer/src/generated/source_io.dart'; | 28 import 'package:analyzer/src/generated/source_io.dart'; |
| 28 import 'package:analyzer/src/generated/testing/ast_factory.dart'; | 29 import 'package:analyzer/src/generated/testing/ast_factory.dart'; |
| 29 import 'package:analyzer/src/generated/testing/element_factory.dart'; | 30 import 'package:analyzer/src/generated/testing/element_factory.dart'; |
| 30 import 'package:analyzer/src/generated/testing/test_type_provider.dart'; | 31 import 'package:analyzer/src/generated/testing/test_type_provider.dart'; |
| 31 import 'package:analyzer/src/generated/testing/token_factory.dart'; | 32 import 'package:analyzer/src/generated/testing/token_factory.dart'; |
| 32 import 'package:analyzer/src/generated/utilities_dart.dart'; | 33 import 'package:analyzer/src/generated/utilities_dart.dart'; |
| 34 import 'package:analyzer/src/source/source_resource.dart'; |
| 33 import 'package:path/path.dart'; | 35 import 'package:path/path.dart'; |
| 34 import 'package:source_span/source_span.dart'; | 36 import 'package:source_span/source_span.dart'; |
| 35 import 'package:unittest/unittest.dart'; | 37 import 'package:unittest/unittest.dart'; |
| 36 | 38 |
| 37 import '../reflective_tests.dart'; | 39 import '../reflective_tests.dart'; |
| 38 import '../utils.dart'; | 40 import '../utils.dart'; |
| 39 import 'parser_test.dart'; | 41 import 'parser_test.dart'; |
| 40 import 'resolver_test_case.dart'; | 42 import 'resolver_test_case.dart'; |
| 41 import 'test_support.dart'; | 43 import 'test_support.dart'; |
| 42 | 44 |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 expect(sdkDirectory, isNotNull, | 308 expect(sdkDirectory, isNotNull, |
| 307 reason: | 309 reason: |
| 308 "No SDK configured; set the property 'com.google.dart.sdk' on the co
mmand line"); | 310 "No SDK configured; set the property 'com.google.dart.sdk' on the co
mmand line"); |
| 309 return new DirectoryBasedDartSdk(sdkDirectory); | 311 return new DirectoryBasedDartSdk(sdkDirectory); |
| 310 } | 312 } |
| 311 } | 313 } |
| 312 | 314 |
| 313 @reflectiveTest | 315 @reflectiveTest |
| 314 class DirectoryBasedSourceContainerTest { | 316 class DirectoryBasedSourceContainerTest { |
| 315 void test_contains() { | 317 void test_contains() { |
| 316 JavaFile dir = FileUtilities2.createFile("/does/not/exist"); | 318 MemoryResourceProvider resourceProvider = new MemoryResourceProvider(); |
| 317 JavaFile file1 = FileUtilities2.createFile("/does/not/exist/some.dart"); | 319 File file1 = resourceProvider.getFile('/does/not/exist/some.dart'); |
| 318 JavaFile file2 = | 320 File file2 = resourceProvider.getFile('/does/not/exist/folder/some2.dart'); |
| 319 FileUtilities2.createFile("/does/not/exist/folder/some2.dart"); | 321 File file3 = resourceProvider.getFile('/does/not/exist3/some3.dart'); |
| 320 JavaFile file3 = FileUtilities2.createFile("/does/not/exist3/some3.dart"); | 322 Source source1 = new FileSource(file1); |
| 321 FileBasedSource source1 = new FileBasedSource(file1); | 323 Source source2 = new FileSource(file2); |
| 322 FileBasedSource source2 = new FileBasedSource(file2); | 324 Source source3 = new FileSource(file3); |
| 323 FileBasedSource source3 = new FileBasedSource(file3); | |
| 324 DirectoryBasedSourceContainer container = | 325 DirectoryBasedSourceContainer container = |
| 325 new DirectoryBasedSourceContainer.con1(dir); | 326 new DirectoryBasedSourceContainer.con2('/does/not/exist'); |
| 326 expect(container.contains(source1), isTrue); | 327 expect(container.contains(source1), isTrue); |
| 327 expect(container.contains(source2), isTrue); | 328 expect(container.contains(source2), isTrue); |
| 328 expect(container.contains(source3), isFalse); | 329 expect(container.contains(source3), isFalse); |
| 329 } | 330 } |
| 330 } | 331 } |
| 331 | 332 |
| 332 @reflectiveTest | 333 @reflectiveTest |
| 333 class ElementBuilderTest extends ParserTestCase { | 334 class ElementBuilderTest extends ParserTestCase { |
| 334 CompilationUnitElement compilationUnitElement; | 335 CompilationUnitElement compilationUnitElement; |
| 335 CompilationUnit compilationUnit; | 336 CompilationUnit compilationUnit; |
| (...skipping 4211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4547 expect(UriKind.fromEncoding(0x70), same(UriKind.PACKAGE_URI)); | 4548 expect(UriKind.fromEncoding(0x70), same(UriKind.PACKAGE_URI)); |
| 4548 expect(UriKind.fromEncoding(0x58), same(null)); | 4549 expect(UriKind.fromEncoding(0x58), same(null)); |
| 4549 } | 4550 } |
| 4550 | 4551 |
| 4551 void test_getEncoding() { | 4552 void test_getEncoding() { |
| 4552 expect(UriKind.DART_URI.encoding, 0x64); | 4553 expect(UriKind.DART_URI.encoding, 0x64); |
| 4553 expect(UriKind.FILE_URI.encoding, 0x66); | 4554 expect(UriKind.FILE_URI.encoding, 0x66); |
| 4554 expect(UriKind.PACKAGE_URI.encoding, 0x70); | 4555 expect(UriKind.PACKAGE_URI.encoding, 0x70); |
| 4555 } | 4556 } |
| 4556 } | 4557 } |
| OLD | NEW |