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

Unified Diff: pkg/front_end/test/fasta/translate_uri_test.dart

Issue 2890883002: Fix for resolving 'bar.dart' against 'dart:foo'. Test for TranslateUri. (Closed)
Patch Set: Created 3 years, 7 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/front_end/lib/src/incremental/file_state.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/test/fasta/translate_uri_test.dart
diff --git a/pkg/front_end/test/fasta/translate_uri_test.dart b/pkg/front_end/test/fasta/translate_uri_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..a4b0f6143b6625a680e0e24499bd215fd145dc20
--- /dev/null
+++ b/pkg/front_end/test/fasta/translate_uri_test.dart
@@ -0,0 +1,33 @@
+// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:front_end/src/fasta/translate_uri.dart';
+import 'package:test/test.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+
+main() {
+ defineReflectiveSuite(() {
+ defineReflectiveTests(TranslateUriTest);
+ });
+}
+
+@reflectiveTest
+class TranslateUriTest {
+ void test_translate_dart() {
+ var translator = new TranslateUri({}, {
+ 'core': Uri.parse('file:///sdk/core/core.dart'),
+ 'math': Uri.parse('file:///sdk/math/math.dart')
+ });
+
+ expect(translator.translate(Uri.parse('dart:core')),
+ Uri.parse('file:///sdk/core/core.dart'));
+ expect(translator.translate(Uri.parse('dart:core/string.dart')),
+ Uri.parse('file:///sdk/core/string.dart'));
+
+ expect(translator.translate(Uri.parse('dart:math')),
+ Uri.parse('file:///sdk/math/math.dart'));
+
+ expect(translator.translate(Uri.parse('dart:unknown')), isNull);
+ }
+}
« no previous file with comments | « pkg/front_end/lib/src/incremental/file_state.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698