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_reflective_loader/test_reflective_loader.dart'; | 9 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
9 import 'package:unittest/unittest.dart'; | |
10 | 10 |
11 import '../utils.dart'; | 11 import '../utils.dart'; |
12 | 12 |
13 main() { | 13 main() { |
14 initializeTestEnvironment(); | 14 initializeTestEnvironment(); |
15 defineReflectiveTests(ResolveRelativeUriTest); | 15 defineReflectiveSuite(() { |
| 16 defineReflectiveTests(ResolveRelativeUriTest); |
| 17 }); |
16 } | 18 } |
17 | 19 |
18 @reflectiveTest | 20 @reflectiveTest |
19 class ResolveRelativeUriTest { | 21 class ResolveRelativeUriTest { |
20 void test_absolute() { | 22 void test_absolute() { |
21 _validate('dart:core', 'dart:async', 'dart:async'); | 23 _validate('dart:core', 'dart:async', 'dart:async'); |
22 _validate('package:foo/foo.dart', 'dart:async', 'dart:async'); | 24 _validate('package:foo/foo.dart', 'dart:async', 'dart:async'); |
23 _validate('package:a/a.dart', 'package:b/b.dart', 'package:b/b.dart'); | 25 _validate('package:a/a.dart', 'package:b/b.dart', 'package:b/b.dart'); |
24 _validate('foo.dart', 'dart:async', 'dart:async'); | 26 _validate('foo.dart', 'dart:async', 'dart:async'); |
25 } | 27 } |
(...skipping 16 matching lines...) Expand all Loading... |
42 // TODO(scheglov) After https://github.com/dart-lang/sdk/issues/27447 | 44 // TODO(scheglov) After https://github.com/dart-lang/sdk/issues/27447 |
43 // TODO(scheglov) include also this, currently failing test. | 45 // TODO(scheglov) include also this, currently failing test. |
44 // _validate('a/b.dart', '../../c.dart', '../c.dart'); | 46 // _validate('a/b.dart', '../../c.dart', '../c.dart'); |
45 } | 47 } |
46 | 48 |
47 void _validate(String base, String contained, String expected) { | 49 void _validate(String base, String contained, String expected) { |
48 Uri actual = resolveRelativeUri(Uri.parse(base), Uri.parse(contained)); | 50 Uri actual = resolveRelativeUri(Uri.parse(base), Uri.parse(contained)); |
49 expect(actual.toString(), expected); | 51 expect(actual.toString(), expected); |
50 } | 52 } |
51 } | 53 } |
OLD | NEW |