| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 library analyzer.test.generated.utilities_dart_test; | 5 library analyzer.test.generated.utilities_dart_test; |
| 6 | 6 |
| 7 import 'package:analyzer/src/generated/utilities_dart.dart'; | 7 import 'package:analyzer/src/generated/utilities_dart.dart'; |
| 8 import 'package:test/test.dart'; | 8 import 'package:test/test.dart'; |
| 9 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 9 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
| 10 | 10 |
| 11 import '../utils.dart'; | |
| 12 | |
| 13 main() { | 11 main() { |
| 14 initializeTestEnvironment(); | |
| 15 defineReflectiveSuite(() { | 12 defineReflectiveSuite(() { |
| 16 defineReflectiveTests(ResolveRelativeUriTest); | 13 defineReflectiveTests(ResolveRelativeUriTest); |
| 17 }); | 14 }); |
| 18 } | 15 } |
| 19 | 16 |
| 20 @reflectiveTest | 17 @reflectiveTest |
| 21 class ResolveRelativeUriTest { | 18 class ResolveRelativeUriTest { |
| 22 void test_absolute() { | 19 void test_absolute() { |
| 23 _validate('dart:core', 'dart:async', 'dart:async'); | 20 _validate('dart:core', 'dart:async', 'dart:async'); |
| 24 _validate('package:foo/foo.dart', 'dart:async', 'dart:async'); | 21 _validate('package:foo/foo.dart', 'dart:async', 'dart:async'); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 44 // TODO(scheglov) After https://github.com/dart-lang/sdk/issues/27447 | 41 // TODO(scheglov) After https://github.com/dart-lang/sdk/issues/27447 |
| 45 // TODO(scheglov) include also this, currently failing test. | 42 // TODO(scheglov) include also this, currently failing test. |
| 46 // _validate('a/b.dart', '../../c.dart', '../c.dart'); | 43 // _validate('a/b.dart', '../../c.dart', '../c.dart'); |
| 47 } | 44 } |
| 48 | 45 |
| 49 void _validate(String base, String contained, String expected) { | 46 void _validate(String base, String contained, String expected) { |
| 50 Uri actual = resolveRelativeUri(Uri.parse(base), Uri.parse(contained)); | 47 Uri actual = resolveRelativeUri(Uri.parse(base), Uri.parse(contained)); |
| 51 expect(actual.toString(), expected); | 48 expect(actual.toString(), expected); |
| 52 } | 49 } |
| 53 } | 50 } |
| OLD | NEW |