Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Unified Diff: pkg/analyzer/test/src/context/builder_test.dart

Issue 2208503004: Move embedder locator and convert context builder to use the new API (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/test/source/embedder_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/context/builder_test.dart
diff --git a/pkg/analyzer/test/src/context/builder_test.dart b/pkg/analyzer/test/src/context/builder_test.dart
index 1f94afa79e13c8e6c58993f1292f0c06196ef2b3..e6ed76f96d33d5bfff63525d72ebf6e90d053c30 100644
--- a/pkg/analyzer/test/src/context/builder_test.dart
+++ b/pkg/analyzer/test/src/context/builder_test.dart
@@ -22,6 +22,7 @@ import 'package:unittest/unittest.dart';
import '../../generated/test_support.dart';
import '../../reflective_tests.dart';
+import '../../source/embedder_test.dart';
import '../../utils.dart';
import 'mock_sdk.dart';
@@ -29,6 +30,7 @@ main() {
initializeTestEnvironment();
runReflectiveTests(ContextBuilderTest_WithDisk);
runReflectiveTests(ContextBuilderTest_WithoutDisk);
+ runReflectiveTests(EmbedderYamlLocatorTest);
}
@reflectiveTest
@@ -695,3 +697,26 @@ analyzer:
expect(actual.finerGrainedInvalidation, expected.finerGrainedInvalidation);
}
}
+
+@reflectiveTest
+class EmbedderYamlLocatorTest extends EmbedderRelatedTest {
+ void test_empty() {
+ EmbedderYamlLocator locator = new EmbedderYamlLocator({
+ 'fox': [pathTranslator.getResource('/empty')]
+ });
+ expect(locator.embedderYamls, hasLength(0));
+ }
+
+ void test_invalid() {
+ EmbedderYamlLocator locator = new EmbedderYamlLocator(null);
+ locator.addEmbedderYaml(null, r'''{{{,{{}}},}}''');
+ expect(locator.embedderYamls, hasLength(0));
+ }
+
+ void test_valid() {
+ EmbedderYamlLocator locator = new EmbedderYamlLocator({
+ 'fox': [pathTranslator.getResource('/tmp')]
+ });
+ expect(locator.embedderYamls, hasLength(1));
+ }
+}
« no previous file with comments | « pkg/analyzer/test/source/embedder_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698