| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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.source.source_resource_test; | 5 library analyzer.test.src.source.source_resource_test; |
| 6 | 6 |
| 7 import 'package:analyzer/file_system/file_system.dart'; | 7 import 'package:analyzer/file_system/file_system.dart'; |
| 8 import 'package:analyzer/file_system/memory_file_system.dart'; | 8 import 'package:analyzer/file_system/memory_file_system.dart'; |
| 9 import 'package:analyzer/file_system/physical_file_system.dart'; | 9 import 'package:analyzer/file_system/physical_file_system.dart'; |
| 10 import 'package:analyzer/src/generated/java_core.dart'; | 10 import 'package:analyzer/src/generated/java_core.dart'; |
| 11 import 'package:analyzer/src/generated/java_engine_io.dart'; | 11 import 'package:analyzer/src/generated/java_engine_io.dart'; |
| 12 import 'package:analyzer/src/generated/sdk.dart'; | 12 import 'package:analyzer/src/generated/sdk.dart'; |
| 13 import 'package:analyzer/src/generated/source.dart'; | 13 import 'package:analyzer/src/generated/source.dart'; |
| 14 import 'package:analyzer/src/generated/utilities_dart.dart'; | 14 import 'package:analyzer/src/generated/utilities_dart.dart'; |
| 15 import 'package:analyzer/src/source/source_resource.dart'; | 15 import 'package:analyzer/src/source/source_resource.dart'; |
| 16 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
| 16 import 'package:unittest/unittest.dart'; | 17 import 'package:unittest/unittest.dart'; |
| 17 | 18 |
| 18 import '../../reflective_tests.dart'; | |
| 19 import '../../utils.dart'; | 19 import '../../utils.dart'; |
| 20 import '../context/mock_sdk.dart'; | 20 import '../context/mock_sdk.dart'; |
| 21 | 21 |
| 22 main() { | 22 main() { |
| 23 initializeTestEnvironment(); | 23 initializeTestEnvironment(); |
| 24 runReflectiveTests(FileSourceTest); | 24 defineReflectiveTests(FileSourceTest); |
| 25 } | 25 } |
| 26 | 26 |
| 27 @reflectiveTest | 27 @reflectiveTest |
| 28 class FileSourceTest { | 28 class FileSourceTest { |
| 29 MemoryResourceProvider resourceProvider = new MemoryResourceProvider(); | 29 MemoryResourceProvider resourceProvider = new MemoryResourceProvider(); |
| 30 | 30 |
| 31 void test_equals_false_differentFiles() { | 31 void test_equals_false_differentFiles() { |
| 32 File file1 = resourceProvider.getFile("/does/not/exist1.dart"); | 32 File file1 = resourceProvider.getFile("/does/not/exist1.dart"); |
| 33 File file2 = resourceProvider.getFile("/does/not/exist2.dart"); | 33 File file2 = resourceProvider.getFile("/does/not/exist2.dart"); |
| 34 FileSource source1 = new FileSource(file1); | 34 FileSource source1 = new FileSource(file1); |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 new FileSource(file, parseUriWithException("dart:core")); | 205 new FileSource(file, parseUriWithException("dart:core")); |
| 206 expect(source, isNotNull); | 206 expect(source, isNotNull); |
| 207 expect(source.fullName, file.path); | 207 expect(source.fullName, file.path); |
| 208 expect(source.isInSystemLibrary, isTrue); | 208 expect(source.isInSystemLibrary, isTrue); |
| 209 } | 209 } |
| 210 | 210 |
| 211 DartSdk _createSdk() { | 211 DartSdk _createSdk() { |
| 212 return new MockSdk(resourceProvider: resourceProvider); | 212 return new MockSdk(resourceProvider: resourceProvider); |
| 213 } | 213 } |
| 214 } | 214 } |
| OLD | NEW |