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

Unified Diff: pkg/docgen/test/single_library_test.dart

Issue 138623002: Enable re-export in docgen. Work in progress. More to come. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 11 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
« no previous file with comments | « pkg/docgen/test/multi_library_test.dart ('k') | pkg/observe/lib/observe.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/docgen/test/single_library_test.dart
diff --git a/pkg/docgen/test/single_library_test.dart b/pkg/docgen/test/single_library_test.dart
index 12cd6b6b0be23294bdba703258e7d78dfccfc175..ed30818fa9033c37e42ae9768163e4f5c4f53f91 100644
--- a/pkg/docgen/test/single_library_test.dart
+++ b/pkg/docgen/test/single_library_test.dart
@@ -50,33 +50,27 @@ main() {
.then(expectAsync1((mirrorSystem) {
var testLibraryUri = new Uri(scheme: 'file',
path: path.absolute(fileName));
- var library = generateLibrary(mirrorSystem.libraries[testLibraryUri]);
+ var library = new Library(mirrorSystem.libraries[testLibraryUri]);
expect(library is Library, isTrue);
var classTypes = library.classes;
- expect(classTypes is ClassGroup, isTrue);
-
var classes = [];
- classes.addAll(classTypes.classes.values);
- classes.addAll(classTypes.errors.values);
+ classes.addAll(classTypes.values);
+ classes.addAll(library.errors.values);
expect(classes.every((e) => e is Class), isTrue);
- expect(classTypes.typedefs.values.every((e) => e is Typedef), isTrue);
+ expect(library.typedefs.values.every((e) => e is Typedef), isTrue);
var classMethodTypes = [];
classes.forEach((e) {
classMethodTypes.add(e.methods);
classMethodTypes.add(e.inheritedMethods);
});
- expect(classMethodTypes.every((e) => e is MethodGroup), isTrue);
+ expect(classMethodTypes.every((e) => e is Map<String, Method>), isTrue);
var classMethods = [];
classMethodTypes.forEach((e) {
- classMethods.addAll(e.setters.values);
- classMethods.addAll(e.getters.values);
- classMethods.addAll(e.constructors.values);
- classMethods.addAll(e.operators.values);
- classMethods.addAll(e.regularMethods.values);
+ classMethods.addAll(e.values);
});
expect(classMethods.every((e) => e is Method), isTrue);
@@ -87,14 +81,10 @@ main() {
expect(methodParameters.every((e) => e is Parameter), isTrue);
var functionTypes = library.functions;
- expect(functionTypes is MethodGroup, isTrue);
+ expect(functionTypes is Map<String, Method>, isTrue);
var functions = [];
- functions.addAll(functionTypes.setters.values);
- functions.addAll(functionTypes.getters.values);
- functions.addAll(functionTypes.constructors.values);
- functions.addAll(functionTypes.operators.values);
- functions.addAll(functionTypes.regularMethods.values);
+ functions.addAll(functionTypes.values);
expect(functions.every((e) => e is Method), isTrue);
var functionParameters = [];
@@ -110,26 +100,23 @@ main() {
// Testing Doc comment for class [A].
var libraryMirror = mirrorSystem.libraries[testLibraryUri];
var classMirror = libraryMirror.classes.values.first;
- var classDocComment = fixReference('A', libraryMirror,
- classMirror, null).children.first.text;
- expect(classDocComment == 'test.A', isTrue);
+ var classDocComment = library.fixReference('A').children.first.text;
+ expect(classDocComment, 'test.A');
// Test for linking to parameter [A]
- var methodMirror = classMirror.methods['doThis'];
- var methodParameterDocComment = fixReference('A', libraryMirror,
- classMirror, methodMirror).children.first.text;
- // TODO(alanknight) : We're not supporting linking to parameters yet
- // expect(methodParameterDocComment == 'test.A.doThis#A', isTrue);
+ var method = getDocgenObject(classMirror.methods['doThis']);
+ var methodParameterDocComment = method.fixReference(
+ 'A').children.first.text;
+ expect(methodParameterDocComment, 'test.A.doThis.A');
// Testing trying to refer to doThis function
- var methodDocComment = fixReference('doThis', libraryMirror,
- classMirror, methodMirror).children.first.text;
- expect(methodDocComment == 'test.A.doThis', isTrue);
+ var methodDocComment = method.fixReference(
+ 'doThis').children.first.text;
+ expect(methodDocComment, 'test.A.doThis');
// Testing something with no reference
- var libraryDocComment = fixReference('foobar', libraryMirror,
- classMirror, methodMirror).text;
- expect(libraryDocComment == 'foobar', isTrue);
+ var libraryDocComment = method.fixReference('foobar').text;
+ expect(libraryDocComment, 'foobar');
})).whenComplete(() => temporaryDir.deleteSync(recursive: true));
});
});
« no previous file with comments | « pkg/docgen/test/multi_library_test.dart ('k') | pkg/observe/lib/observe.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698