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

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

Issue 2977703002: Refactorings for TranslateUri and its tests. (Closed)
Patch Set: Replace `file` with just word 'file' in documentation. Created 3 years, 5 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
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
index ebdd69cb7c473ec166e40d5fdbe015b229296272..139936d51552961b3a0e3a21922d8f2388c720a8 100644
--- a/pkg/front_end/test/fasta/translate_uri_test.dart
+++ b/pkg/front_end/test/fasta/translate_uri_test.dart
@@ -14,11 +14,28 @@ main() {
@reflectiveTest
class TranslateUriTest {
+ void test_isPlatformImplementation() {
+ var translator = new TranslateUri({
+ 'core': Uri.parse('file:///sdk/core/core.dart'),
+ 'math': Uri.parse('file:///sdk/math/math.dart')
+ }, {}, {});
+
+ bool isPlatform(String uriStr) {
+ var uri = Uri.parse(uriStr);
+ return translator.isPlatformImplementation(uri);
+ }
+
+ expect(isPlatform('dart:core/string.dart'), isTrue);
+ expect(isPlatform('dart:core'), isFalse);
+ expect(isPlatform('dart:_builtin'), isTrue);
+ expect(isPlatform('file:///sdk/math/math.dart'), isFalse);
+ }
+
void test_translate_dart() {
- var translator = new TranslateUri({}, {
+ 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'));
@@ -27,19 +44,5 @@ class TranslateUriTest {
expect(translator.translate(Uri.parse('dart:math')),
Uri.parse('file:///sdk/math/math.dart'));
-
- expect(translator.translate(Uri.parse('dart:unknown')), isNull);
-
- expect(
- translator.isPlatformImplementation(Uri.parse('dart:core/string.dart')),
- isTrue);
- expect(
- translator.isPlatformImplementation(Uri.parse('dart:core')), isFalse);
- expect(translator.isPlatformImplementation(Uri.parse('dart:_builtin')),
- isTrue);
- expect(
- translator
- .isPlatformImplementation(Uri.parse('file:///sdk/math/math.dart')),
- isFalse);
}
}
« pkg/front_end/lib/src/fasta/translate_uri.dart ('K') | « pkg/front_end/test/fasta/testing/suite.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698