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

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

Issue 18324015: "Reverting 24760" (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/pubspec.yaml ('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
(Empty)
1 library single_library_test;
2
3 import 'dart:io';
4
5 import 'package:unittest/unittest.dart';
6
7 import '../lib/docgen.dart';
8 import '../../../sdk/lib/_internal/compiler/implementation/filenames.dart';
9
10 main() {
11 group('Generate docs for', () {
12 test('one simple file.', () {
13 var file = new File('test.dart');
14 file.writeAsStringSync('''
15 library test;
16 /**
17 * Doc comment for class A.
18 *
19 * Multiline Test
20 */
21 /*
22 * Normal comment for class A.
23 */
24 class A {
25
26 /**
27 * Markdown _test_ for **class** [A]
28 */
29 int _someNumber;
30
31 A() {
32 _someNumber = 12;
33 }
34
35 void doThis(int a) {
36 print(a);
37 }
38 }
39
40 main() {
41 A a = new A();
42 a.doThis(5);
43 }
44 ''');
45
46 getMirrorSystem(['test.dart'],'', parseSdk: false)
47 .then(expectAsync1((mirrorSystem) {
48 var testLibraryUri = currentDirectory.resolve('test.dart');
49 var library = generateLibrary(mirrorSystem.libraries[testLibraryUri],
50 includePrivate: true);
51 expect(library is Library, isTrue);
52
53 var classes = library.classes.values;
54 expect(classes.every((e) => e is Class), isTrue);
55
56 var classMethods = [];
57 classes.forEach((e) => classMethods.addAll(e.methods.values));
58 expect(classMethods.every((e) => e is Method), isTrue);
59
60 var methodParameters = [];
61 classMethods.forEach((e) {
62 methodParameters.addAll(e.parameters.values);
63 });
64 expect(methodParameters.every((e) => e is Parameter), isTrue);
65
66 var functions = library.functions.values;
67 expect(functions.every((e) => e is Method), isTrue);
68
69 var functionParameters = [];
70 functions.forEach((e) {
71 functionParameters.addAll(e.parameters.values);
72 });
73 expect(functionParameters.every((e) => e is Parameter), isTrue);
74
75 var variables = library.variables.values;
76 expect(variables.every((e) => e is Variable), isTrue);
77
78 file.deleteSync();
79 }));
80 });
81 });
82 }
OLDNEW
« no previous file with comments | « pkg/docgen/pubspec.yaml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698