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

Side by Side Diff: pkg/front_end/test/fasta/translate_uri_test.dart

Issue 2895983002: Read SDK and patches from a JSON file. (Closed)
Patch Set: Merged with 1333f97b9a0e3805f991578ef83b0ec4553ecf33 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 unified diff | Download patch
OLDNEW
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 'package:front_end/src/fasta/translate_uri.dart'; 5 import 'package:front_end/src/fasta/translate_uri.dart';
6 import 'package:test/test.dart'; 6 import 'package:test/test.dart';
7 import 'package:test_reflective_loader/test_reflective_loader.dart'; 7 import 'package:test_reflective_loader/test_reflective_loader.dart';
8 8
9 main() { 9 main() {
10 defineReflectiveSuite(() { 10 defineReflectiveSuite(() {
11 defineReflectiveTests(TranslateUriTest); 11 defineReflectiveTests(TranslateUriTest);
12 }); 12 });
13 } 13 }
14 14
15 @reflectiveTest 15 @reflectiveTest
16 class TranslateUriTest { 16 class TranslateUriTest {
17 void test_translate_dart() { 17 void test_translate_dart() {
18 var translator = new TranslateUri({}, { 18 var translator = new TranslateUri({}, {
19 'core': Uri.parse('file:///sdk/core/core.dart'), 19 'core': Uri.parse('file:///sdk/core/core.dart'),
20 'math': Uri.parse('file:///sdk/math/math.dart') 20 'math': Uri.parse('file:///sdk/math/math.dart')
21 }); 21 }, {});
22 22
23 expect(translator.translate(Uri.parse('dart:core')), 23 expect(translator.translate(Uri.parse('dart:core')),
24 Uri.parse('file:///sdk/core/core.dart')); 24 Uri.parse('file:///sdk/core/core.dart'));
25 expect(translator.translate(Uri.parse('dart:core/string.dart')), 25 expect(translator.translate(Uri.parse('dart:core/string.dart')),
26 Uri.parse('file:///sdk/core/string.dart')); 26 Uri.parse('file:///sdk/core/string.dart'));
27 27
28 expect(translator.translate(Uri.parse('dart:math')), 28 expect(translator.translate(Uri.parse('dart:math')),
29 Uri.parse('file:///sdk/math/math.dart')); 29 Uri.parse('file:///sdk/math/math.dart'));
30 30
31 expect(translator.translate(Uri.parse('dart:unknown')), isNull); 31 expect(translator.translate(Uri.parse('dart:unknown')), isNull);
32
33 expect(
34 translator.isPlatformImplementation(Uri.parse('dart:core/string.dart')),
35 isTrue);
36 expect(
37 translator.isPlatformImplementation(Uri.parse('dart:core')), isFalse);
38 expect(translator.isPlatformImplementation(Uri.parse('dart:_builtin')),
39 isTrue);
40 expect(
41 translator
42 .isPlatformImplementation(Uri.parse('file:///sdk/math/math.dart')),
43 isFalse);
32 } 44 }
33 } 45 }
OLDNEW
« no previous file with comments | « pkg/front_end/test/fasta/testing/suite.dart ('k') | pkg/front_end/test/src/incremental/file_state_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698