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

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
« no previous file with comments | « 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 main() { 42 main() {
43 A a = new A(); 43 A a = new A();
44 a.doThis(5); 44 a.doThis(5);
45 } 45 }
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);
54 expect(library is Library, isTrue); 53 expect(library is Library, isTrue);
55 54
56 var classTypes = library.classes.values; 55 var classTypes = library.classes;
57 expect(classTypes.every((e) => e is Map), isTrue); 56 expect(classTypes is ClassGroup, isTrue);
58 57
59 var classes = []; 58 var classes = [];
60 classTypes.forEach((e) => classes.addAll(e.values)); 59 classes.addAll(classTypes.abstractClasses.values);
60 classes.addAll(classTypes.regularClasses.values);
61 classes.addAll(classTypes.errors.values);
61 expect(classes.every((e) => e is Class), isTrue); 62 expect(classes.every((e) => e is Class), isTrue);
62 63
64 expect(classTypes.typedefs.values.every((e) => e is Typedef), isTrue);
65
63 var classMethodTypes = []; 66 var classMethodTypes = [];
64 classes.forEach((e) => classMethodTypes.addAll(e.methods.values)); 67 classes.forEach((e) {
65 expect(classMethodTypes.every((e) => e is Map), isTrue); 68 classMethodTypes.add(e.methods);
69 classMethodTypes.add(e.inheritedMethods);
70 });
71 expect(classMethodTypes.every((e) => e is MethodGroup), isTrue);
66 72
67 var classMethods = []; 73 var classMethods = [];
68 classMethodTypes.forEach((e) => classMethods.addAll(e.values)); 74 classMethodTypes.forEach((e) {
75 classMethods.addAll(e.setters.values);
76 classMethods.addAll(e.getters.values);
77 classMethods.addAll(e.constructors.values);
78 classMethods.addAll(e.operators.values);
79 classMethods.addAll(e.regularMethods.values);
80 });
69 expect(classMethods.every((e) => e is Method), isTrue); 81 expect(classMethods.every((e) => e is Method), isTrue);
70 82
71 var methodParameters = []; 83 var methodParameters = [];
72 classMethods.forEach((e) { 84 classMethods.forEach((e) {
73 methodParameters.addAll(e.parameters.values); 85 methodParameters.addAll(e.parameters.values);
74 }); 86 });
75 expect(methodParameters.every((e) => e is Parameter), isTrue); 87 expect(methodParameters.every((e) => e is Parameter), isTrue);
76 88
77 var functionTypes = library.functions.values; 89 var functionTypes = library.functions;
78 expect(functionTypes.every((e) => e is Map), isTrue); 90 expect(functionTypes is MethodGroup, isTrue);
79 91
80 var functions = []; 92 var functions = [];
81 functionTypes.forEach((e) => functions.addAll(e.values)); 93 functions.addAll(functionTypes.setters.values);
94 functions.addAll(functionTypes.getters.values);
95 functions.addAll(functionTypes.constructors.values);
96 functions.addAll(functionTypes.operators.values);
97 functions.addAll(functionTypes.regularMethods.values);
82 expect(functions.every((e) => e is Method), isTrue); 98 expect(functions.every((e) => e is Method), isTrue);
83 99
84 var functionParameters = []; 100 var functionParameters = [];
85 functions.forEach((e) { 101 functions.forEach((e) {
86 functionParameters.addAll(e.parameters.values); 102 functionParameters.addAll(e.parameters.values);
87 }); 103 });
88 expect(functionParameters.every((e) => e is Parameter), isTrue); 104 expect(functionParameters.every((e) => e is Parameter), isTrue);
89 105
90 var variables = library.variables.values; 106 var variables = library.variables.values;
91 expect(variables.every((e) => e is Variable), isTrue); 107 expect(variables.every((e) => e is Variable), isTrue);
(...skipping 18 matching lines...) Expand all
110 expect(methodDocComment == 'test.A.doThis', isTrue); 126 expect(methodDocComment == 'test.A.doThis', isTrue);
111 127
112 // Testing something with no reference 128 // Testing something with no reference
113 var libraryDocComment = fixReference('foobar', libraryMirror, 129 var libraryDocComment = fixReference('foobar', libraryMirror,
114 classMirror, methodMirror).children.first.text; 130 classMirror, methodMirror).children.first.text;
115 expect(libraryDocComment == 'foobar', isTrue); 131 expect(libraryDocComment == 'foobar', isTrue);
116 })).whenComplete(() => temporaryDir.deleteSync(recursive: true)); 132 })).whenComplete(() => temporaryDir.deleteSync(recursive: true));
117 }); 133 });
118 }); 134 });
119 } 135 }
OLDNEW
« no previous file with comments | « pkg/docgen/lib/docgen.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698