| 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 'dart:async'; | 5 import 'dart:async'; |
| 6 | 6 |
| 7 import 'package:front_end/compiler_options.dart'; | 7 import 'package:front_end/compiler_options.dart'; |
| 8 import 'package:front_end/incremental_kernel_generator.dart'; | 8 import 'package:front_end/incremental_kernel_generator.dart'; |
| 9 import 'package:front_end/memory_file_system.dart'; | 9 import 'package:front_end/memory_file_system.dart'; |
| 10 import 'package:front_end/src/fasta/kernel/utils.dart'; | 10 import 'package:front_end/src/fasta/kernel/utils.dart'; |
| (...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 837 fileSystem.entityForUri(uri).writeAsStringSync(text); | 837 fileSystem.entityForUri(uri).writeAsStringSync(text); |
| 838 return uri; | 838 return uri; |
| 839 } | 839 } |
| 840 | 840 |
| 841 /// Write the given file contents to the virtual filesystem. | 841 /// Write the given file contents to the virtual filesystem. |
| 842 void writeFiles(Map<String, String> contents) { | 842 void writeFiles(Map<String, String> contents) { |
| 843 contents.forEach(writeFile); | 843 contents.forEach(writeFile); |
| 844 } | 844 } |
| 845 | 845 |
| 846 void _assertCompiledUris(Iterable<Uri> expected) { | 846 void _assertCompiledUris(Iterable<Uri> expected) { |
| 847 var compiledCycles = incrementalKernelGenerator.test.compiledCycles; | 847 var compiledCycles = |
| 848 incrementalKernelGenerator.test.driver.test.compiledCycles; |
| 848 Set<Uri> compiledUris = compiledCycles | 849 Set<Uri> compiledUris = compiledCycles |
| 849 .map((cycle) => cycle.libraries.map((file) => file.uri)) | 850 .map((cycle) => cycle.libraries.map((file) => file.uri)) |
| 850 .expand((uris) => uris) | 851 .expand((uris) => uris) |
| 851 .toSet(); | 852 .toSet(); |
| 852 expect(compiledUris, unorderedEquals(expected)); | 853 expect(compiledUris, unorderedEquals(expected)); |
| 853 } | 854 } |
| 854 | 855 |
| 855 void _assertLibraryUris(Program program, | 856 void _assertLibraryUris(Program program, |
| 856 {List<Uri> includes: const [], List<Uri> excludes: const []}) { | 857 {List<Uri> includes: const [], List<Uri> excludes: const []}) { |
| 857 List<Uri> libraryUris = | 858 List<Uri> libraryUris = |
| (...skipping 13 matching lines...) Expand all Loading... |
| 871 throw fail('No library found with URI "$uri"'); | 872 throw fail('No library found with URI "$uri"'); |
| 872 } | 873 } |
| 873 | 874 |
| 874 String _getLibraryText(Library library) { | 875 String _getLibraryText(Library library) { |
| 875 StringBuffer buffer = new StringBuffer(); | 876 StringBuffer buffer = new StringBuffer(); |
| 876 new Printer(buffer, syntheticNames: new NameSystem()) | 877 new Printer(buffer, syntheticNames: new NameSystem()) |
| 877 .writeLibraryFile(library); | 878 .writeLibraryFile(library); |
| 878 return buffer.toString(); | 879 return buffer.toString(); |
| 879 } | 880 } |
| 880 } | 881 } |
| OLD | NEW |