OLD | NEW |
(Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 import 'package:front_end/src/fasta/translate_uri.dart'; |
| 6 import 'package:test/test.dart'; |
| 7 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
| 8 |
| 9 main() { |
| 10 defineReflectiveSuite(() { |
| 11 defineReflectiveTests(TranslateUriTest); |
| 12 }); |
| 13 } |
| 14 |
| 15 @reflectiveTest |
| 16 class TranslateUriTest { |
| 17 void test_translate_dart() { |
| 18 var translator = new TranslateUri({}, { |
| 19 'core': Uri.parse('file:///sdk/core/core.dart'), |
| 20 'math': Uri.parse('file:///sdk/math/math.dart') |
| 21 }); |
| 22 |
| 23 expect(translator.translate(Uri.parse('dart:core')), |
| 24 Uri.parse('file:///sdk/core/core.dart')); |
| 25 expect(translator.translate(Uri.parse('dart:core/string.dart')), |
| 26 Uri.parse('file:///sdk/core/string.dart')); |
| 27 |
| 28 expect(translator.translate(Uri.parse('dart:math')), |
| 29 Uri.parse('file:///sdk/math/math.dart')); |
| 30 |
| 31 expect(translator.translate(Uri.parse('dart:unknown')), isNull); |
| 32 } |
| 33 } |
OLD | NEW |