OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 import 'package:front_end/memory_file_system.dart'; | 5 import 'package:front_end/memory_file_system.dart'; |
6 import 'package:front_end/src/fasta/translate_uri.dart'; | 6 import 'package:front_end/src/fasta/translate_uri.dart'; |
7 import 'package:front_end/src/incremental/file_state.dart'; | 7 import 'package:front_end/src/incremental/file_state.dart'; |
8 import 'package:test/test.dart'; | 8 import 'package:test/test.dart'; |
9 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 9 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
10 | 10 |
11 import 'mock_sdk.dart'; | 11 import 'mock_sdk.dart'; |
12 | 12 |
13 main() { | 13 main() { |
14 defineReflectiveSuite(() { | 14 defineReflectiveSuite(() { |
15 defineReflectiveTests(FileSystemStateTest); | 15 defineReflectiveTests(FileSystemStateTest); |
16 }); | 16 }); |
17 } | 17 } |
18 | 18 |
19 @reflectiveTest | 19 @reflectiveTest |
20 class FileSystemStateTest { | 20 class FileSystemStateTest { |
21 final fileSystem = new MemoryFileSystem(Uri.parse('file:///')); | 21 final fileSystem = new MemoryFileSystem(Uri.parse('file:///')); |
22 final TranslateUri uriTranslator = new TranslateUri({}, {}); | 22 final TranslateUri uriTranslator = new TranslateUri({}, {}, {}); |
23 FileSystemState fsState; | 23 FileSystemState fsState; |
24 | 24 |
25 Uri _coreUri; | 25 Uri _coreUri; |
26 | 26 |
27 void setUp() { | 27 void setUp() { |
28 Map<String, Uri> dartLibraries = createSdkFiles(fileSystem); | 28 Map<String, Uri> dartLibraries = createSdkFiles(fileSystem); |
29 uriTranslator.dartLibraries.addAll(dartLibraries); | 29 uriTranslator.dartLibraries.addAll(dartLibraries); |
30 _coreUri = Uri.parse('dart:core'); | 30 _coreUri = Uri.parse('dart:core'); |
31 expect(_coreUri, isNotNull); | 31 expect(_coreUri, isNotNull); |
32 fsState = new FileSystemState(fileSystem, uriTranslator); | 32 fsState = new FileSystemState(fileSystem, uriTranslator); |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 Uri _writeFileDirectives(String path, | 204 Uri _writeFileDirectives(String path, |
205 {List<String> imports: const [], List<String> exports: const []}) { | 205 {List<String> imports: const [], List<String> exports: const []}) { |
206 return writeFile( | 206 return writeFile( |
207 path, | 207 path, |
208 ''' | 208 ''' |
209 ${imports.map((uri) => 'import "$uri";').join('\n')} | 209 ${imports.map((uri) => 'import "$uri";').join('\n')} |
210 ${exports.map((uri) => 'export "$uri";').join('\n')} | 210 ${exports.map((uri) => 'export "$uri";').join('\n')} |
211 '''); | 211 '''); |
212 } | 212 } |
213 } | 213 } |
OLD | NEW |