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

Side by Side Diff: pkg/docgen/test/single_library_test.dart

Issue 21096002: added inherited methods and variables (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« pkg/docgen/lib/docgen.dart ('K') | « pkg/docgen/lib/docgen.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 library single_library_test; 1 library single_library_test;
2 2
3 import 'dart:io'; 3 import 'dart:io';
4 4
5 import 'package:path/path.dart' as path; 5 import 'package:path/path.dart' as path;
6 import 'package:unittest/unittest.dart'; 6 import 'package:unittest/unittest.dart';
7 7
8 import '../lib/docgen.dart'; 8 import '../lib/docgen.dart';
9 9
10 main() { 10 main() {
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 '''); 46 ''');
47 47
48 getMirrorSystem([fileName]) 48 getMirrorSystem([fileName])
49 .then(expectAsync1((mirrorSystem) { 49 .then(expectAsync1((mirrorSystem) {
50 var testLibraryUri = new Uri(scheme: 'file', 50 var testLibraryUri = new Uri(scheme: 'file',
51 path: path.absolute(fileName)); 51 path: path.absolute(fileName));
52 var library = generateLibrary(mirrorSystem.libraries[testLibraryUri], 52 var library = generateLibrary(mirrorSystem.libraries[testLibraryUri],
53 includePrivate: false); 53 includePrivate: false);
54 expect(library is Library, isTrue); 54 expect(library is Library, isTrue);
55 55
56 var classTypes = library.classes.values; 56 var classTypes = library.classes;
57 expect(classTypes.every((e) => e is Map), isTrue); 57 expect(classTypes is ClassGroup, isTrue);
58 58
59 var classes = []; 59 var classes = [];
60 classTypes.forEach((e) => classes.addAll(e.values)); 60 classes.addAll(classTypes.abstractClasses.values);
61 classes.addAll(classTypes.regularClasses.values);
62 classes.addAll(classTypes.errors.values);
61 expect(classes.every((e) => e is Class), isTrue); 63 expect(classes.every((e) => e is Class), isTrue);
62 64
65 expect(classTypes.typedefs.values.every((e) => e is Typedef), isTrue);
66
63 var classMethodTypes = []; 67 var classMethodTypes = [];
64 classes.forEach((e) => classMethodTypes.addAll(e.methods.values)); 68 classes.forEach((e) {
65 expect(classMethodTypes.every((e) => e is Map), isTrue); 69 classMethodTypes.add(e.methods);
70 classMethodTypes.add(e.inheritedMethods);
71 });
72 expect(classMethodTypes.every((e) => e is MethodGroup), isTrue);
66 73
67 var classMethods = []; 74 var classMethods = [];
68 classMethodTypes.forEach((e) => classMethods.addAll(e.values)); 75 classMethodTypes.forEach((e) {
76 classMethods.addAll(e.setters.values);
77 classMethods.addAll(e.getters.values);
78 classMethods.addAll(e.constructors.values);
79 classMethods.addAll(e.operators.values);
80 classMethods.addAll(e.regularMethods.values);
81 });
69 expect(classMethods.every((e) => e is Method), isTrue); 82 expect(classMethods.every((e) => e is Method), isTrue);
70 83
71 var methodParameters = []; 84 var methodParameters = [];
72 classMethods.forEach((e) { 85 classMethods.forEach((e) {
73 methodParameters.addAll(e.parameters.values); 86 methodParameters.addAll(e.parameters.values);
74 }); 87 });
75 expect(methodParameters.every((e) => e is Parameter), isTrue); 88 expect(methodParameters.every((e) => e is Parameter), isTrue);
76 89
77 var functionTypes = library.functions.values; 90 var functionTypes = library.functions;
78 expect(functionTypes.every((e) => e is Map), isTrue); 91 expect(functionTypes is MethodGroup, isTrue);
79 92
80 var functions = []; 93 var functions = [];
81 functionTypes.forEach((e) => functions.addAll(e.values)); 94 functions.addAll(functionTypes.setters.values);
95 functions.addAll(functionTypes.getters.values);
96 functions.addAll(functionTypes.constructors.values);
97 functions.addAll(functionTypes.operators.values);
98 functions.addAll(functionTypes.regularMethods.values);
82 expect(functions.every((e) => e is Method), isTrue); 99 expect(functions.every((e) => e is Method), isTrue);
83 100
84 var functionParameters = []; 101 var functionParameters = [];
85 functions.forEach((e) { 102 functions.forEach((e) {
86 functionParameters.addAll(e.parameters.values); 103 functionParameters.addAll(e.parameters.values);
87 }); 104 });
88 expect(functionParameters.every((e) => e is Parameter), isTrue); 105 expect(functionParameters.every((e) => e is Parameter), isTrue);
89 106
90 var variables = library.variables.values; 107 var variables = library.variables.values;
91 expect(variables.every((e) => e is Variable), isTrue); 108 expect(variables.every((e) => e is Variable), isTrue);
(...skipping 18 matching lines...) Expand all
110 expect(methodDocComment == 'test.A.doThis', isTrue); 127 expect(methodDocComment == 'test.A.doThis', isTrue);
111 128
112 // Testing something with no reference 129 // Testing something with no reference
113 var libraryDocComment = fixReference('foobar', libraryMirror, 130 var libraryDocComment = fixReference('foobar', libraryMirror,
114 classMirror, methodMirror).children.first.text; 131 classMirror, methodMirror).children.first.text;
115 expect(libraryDocComment == 'foobar', isTrue); 132 expect(libraryDocComment == 'foobar', isTrue);
116 })).whenComplete(() => temporaryDir.deleteSync(recursive: true)); 133 })).whenComplete(() => temporaryDir.deleteSync(recursive: true));
117 }); 134 });
118 }); 135 });
119 } 136 }
OLDNEW
« pkg/docgen/lib/docgen.dart ('K') | « pkg/docgen/lib/docgen.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698