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

Unified Diff: sdk/lib/_internal/dartdoc/test/export_map_test.dart

Issue 13878002: Fix the dartdoc build. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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: sdk/lib/_internal/dartdoc/test/export_map_test.dart
diff --git a/sdk/lib/_internal/dartdoc/test/export_map_test.dart b/sdk/lib/_internal/dartdoc/test/export_map_test.dart
index e66d6a9d0aa22201d7dea3dcebbec381f7f14787..f7b5ab831b24a3ad23d58101f7333f5f7c38a2fc 100644
--- a/sdk/lib/_internal/dartdoc/test/export_map_test.dart
+++ b/sdk/lib/_internal/dartdoc/test/export_map_test.dart
@@ -3,11 +3,13 @@
// BSD-style license that can be found in the LICENSE file.
import 'dart:io';
+import 'dart:uri';
import 'package:pathos/path.dart' as pathos;
import 'package:unittest/unittest.dart';
import '../lib/src/export_map.dart';
+import '../lib/src/dartdoc/utils.dart';
String tempDir;
@@ -240,6 +242,33 @@ main() {
new Export(libPath('a.dart'), libPath(bPath))
]));
});
+
+ test('ignores dart: exports', () {
+ createLibrary('a.dart', 'export "dart:async";');
+ var map = parse(['a.dart']);
+ expect(map.exports[libPath('a.dart')], isEmpty);
+ });
+
+ test('.parse() resolves package: imports', () {
+ var aPath = pathos.join('packages', 'a', 'a.dart');
+ createLibrary(aPath, 'export "package:b/b.dart";');
+ var bPath = pathos.join('packages', 'b', 'b.dart');
+ createLibrary(bPath);
+ var map = new ExportMap.parse(
+ [Uri.parse('package:a/a.dart')],
+ pathos.join(tempDir, 'packages'));
+
+ expect(map.exports[libPath(aPath)], unorderedEquals([
+ new Export(libPath(aPath), libPath(bPath))
+ ]));
+ });
+
+ test('.parse() ignores dart: imports', () {
+ var map = new ExportMap.parse(
+ [Uri.parse('dart:async')],
+ pathos.join(tempDir, 'packages'));
+ expect(map.exports, isEmpty);
+ });
});
group('Export', () {
@@ -344,7 +373,9 @@ main() {
}
ExportMap parse(List<String> libraries) =>
- new ExportMap.parse(libraries.map(libPath), pathos.join(tempDir, 'packages'));
+ new ExportMap.parse(
+ libraries.map(libPath).map(pathToFileUri),
Andrei Mouravski 2013/04/09 01:48:36 I would put the second map on the next line to be
nweiz 2013/04/09 02:10:23 Done.
+ pathos.join(tempDir, 'packages'));
void createLibrary(String name, [String contents]) {
if (contents == null) contents = '';

Powered by Google App Engine
This is Rietveld 408576698