| 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.context.context_builder_test; | 5 library analyzer.test.src.context.context_builder_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/source/package_map_resolver.dart'; | 9 import 'package:analyzer/source/package_map_resolver.dart'; |
| 10 import 'package:analyzer/src/context/builder.dart'; | 10 import 'package:analyzer/src/context/builder.dart'; |
| (...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 626 Uri _relativeUri(String path, {String from}) { | 626 Uri _relativeUri(String path, {String from}) { |
| 627 String relativePath = pathContext.relative(path, from: from); | 627 String relativePath = pathContext.relative(path, from: from); |
| 628 return pathContext.toUri(relativePath); | 628 return pathContext.toUri(relativePath); |
| 629 } | 629 } |
| 630 } | 630 } |
| 631 | 631 |
| 632 @reflectiveTest | 632 @reflectiveTest |
| 633 class EmbedderYamlLocatorTest extends EmbedderRelatedTest { | 633 class EmbedderYamlLocatorTest extends EmbedderRelatedTest { |
| 634 void test_empty() { | 634 void test_empty() { |
| 635 EmbedderYamlLocator locator = new EmbedderYamlLocator({ | 635 EmbedderYamlLocator locator = new EmbedderYamlLocator({ |
| 636 'fox': [pathTranslator.getResource('/empty')] | 636 'fox': [pathTranslator.getResource(emptyPath)] |
| 637 }); | 637 }); |
| 638 expect(locator.embedderYamls, hasLength(0)); | 638 expect(locator.embedderYamls, hasLength(0)); |
| 639 } | 639 } |
| 640 | 640 |
| 641 void test_invalid() { | 641 void test_invalid() { |
| 642 EmbedderYamlLocator locator = new EmbedderYamlLocator(null); | 642 EmbedderYamlLocator locator = new EmbedderYamlLocator(null); |
| 643 locator.addEmbedderYaml(null, r'''{{{,{{}}},}}'''); | 643 locator.addEmbedderYaml(null, r'''{{{,{{}}},}}'''); |
| 644 expect(locator.embedderYamls, hasLength(0)); | 644 expect(locator.embedderYamls, hasLength(0)); |
| 645 } | 645 } |
| 646 | 646 |
| 647 void test_valid() { | 647 void test_valid() { |
| 648 EmbedderYamlLocator locator = new EmbedderYamlLocator({ | 648 EmbedderYamlLocator locator = new EmbedderYamlLocator({ |
| 649 'fox': [pathTranslator.getResource('/tmp')] | 649 'fox': [pathTranslator.getResource(foxLib)] |
| 650 }); | 650 }); |
| 651 expect(locator.embedderYamls, hasLength(1)); | 651 expect(locator.embedderYamls, hasLength(1)); |
| 652 } | 652 } |
| 653 } | 653 } |
| OLD | NEW |