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

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

Issue 19220006: Updated the schema of the yaml output. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 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/src/io.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:unittest/unittest.dart'; 5 import 'package:unittest/unittest.dart';
6 6
7 import '../lib/docgen.dart'; 7 import '../lib/docgen.dart';
8 import '../../../sdk/lib/_internal/compiler/implementation/filenames.dart'; 8 import '../../../sdk/lib/_internal/compiler/implementation/filenames.dart';
9 9
10 main() { 10 main() {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 getMirrorSystem(['test.dart'],'', parseSdk: false) 50 getMirrorSystem(['test.dart'],'', parseSdk: false)
51 .then(expectAsync1((mirrorSystem) { 51 .then(expectAsync1((mirrorSystem) {
52 var testLibraryUri = currentDirectory.resolve('test.dart'); 52 var testLibraryUri = currentDirectory.resolve('test.dart');
53 var library = generateLibrary(mirrorSystem.libraries[testLibraryUri], 53 var library = generateLibrary(mirrorSystem.libraries[testLibraryUri],
54 includePrivate: true); 54 includePrivate: true);
55 expect(library is Library, isTrue); 55 expect(library is Library, isTrue);
56 56
57 var classes = library.classes.values; 57 var classes = library.classes.values;
58 expect(classes.every((e) => e is Class), isTrue); 58 expect(classes.every((e) => e is Class), isTrue);
59 59
60 var classMethodTypes = [];
61 classes.forEach((e) => classMethodTypes.addAll(e.methods.values));
62 expect(classMethodTypes.every((e) => e is Map), isTrue);
63
60 var classMethods = []; 64 var classMethods = [];
61 classes.forEach((e) => classMethods.addAll(e.methods.values)); 65 classMethodTypes.forEach((e) => classMethods.addAll(e.values));
62 expect(classMethods.every((e) => e is Method), isTrue); 66 expect(classMethods.every((e) => e is Method), isTrue);
63 67
64 var methodParameters = []; 68 var methodParameters = [];
65 classMethods.forEach((e) { 69 classMethods.forEach((e) {
66 methodParameters.addAll(e.parameters.values); 70 methodParameters.addAll(e.parameters.values);
67 }); 71 });
68 expect(methodParameters.every((e) => e is Parameter), isTrue); 72 expect(methodParameters.every((e) => e is Parameter), isTrue);
69 73
70 var functions = library.functions.values; 74 var functionTypes = library.functions.values;
75 expect(functionTypes.every((e) => e is Map), isTrue);
76
77 var functions = [];
78 functionTypes.forEach((e) => functions.addAll(e.values));
71 expect(functions.every((e) => e is Method), isTrue); 79 expect(functions.every((e) => e is Method), isTrue);
72 80
73 var functionParameters = []; 81 var functionParameters = [];
74 functions.forEach((e) { 82 functions.forEach((e) {
75 functionParameters.addAll(e.parameters.values); 83 functionParameters.addAll(e.parameters.values);
76 }); 84 });
77 expect(functionParameters.every((e) => e is Parameter), isTrue); 85 expect(functionParameters.every((e) => e is Parameter), isTrue);
78 86
79 var variables = library.variables.values; 87 var variables = library.variables.values;
80 expect(variables.every((e) => e is Variable), isTrue); 88 expect(variables.every((e) => e is Variable), isTrue);
(...skipping 20 matching lines...) Expand all
101 // Testing something with no reference 109 // Testing something with no reference
102 var libraryDocComment = fixReference('foobar', libraryMirror, 110 var libraryDocComment = fixReference('foobar', libraryMirror,
103 classMirror, methodMirror).children.first.text; 111 classMirror, methodMirror).children.first.text;
104 expect(libraryDocComment == 'foobar', isTrue); 112 expect(libraryDocComment == 'foobar', isTrue);
105 113
106 file.deleteSync(); 114 file.deleteSync();
107 })); 115 }));
108 }); 116 });
109 }); 117 });
110 } 118 }
OLDNEW
« no previous file with comments | « pkg/docgen/lib/src/io.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698