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

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

Issue 19888005: removed docgen/test/single_library_test: Skip # Uses js_helper (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/docgen.dart ('k') | pkg/pkg.status » ('j') | 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:unittest/unittest.dart'; 6 import 'package:unittest/unittest.dart';
6 7
7 import '../lib/docgen.dart'; 8 import '../lib/docgen.dart';
8 import '../../../sdk/lib/_internal/compiler/implementation/filenames.dart';
9 9
10 main() { 10 main() {
11 group('Generate docs for', () { 11 group('Generate docs for', () {
12 test('one simple file.', () { 12 test('one simple file.', () {
13 // TODO(janicejl): Instead of creating a new file, should use an in-memory 13 var current = Directory.current;
14 // file for creating the mirrorSystem. Example of the util function in 14 var temporaryDir = new Directory('single_library').createTempSync();
15 // sdk/lib/_internal/compiler/implementation/mirrors/mirrors_util.dart. 15 Directory.current = temporaryDir;
Emily Fortuna 2013/07/22 23:09:10 how about instead of setting your current director
janicejl 2013/07/22 23:27:45 Done.
16 // Example of the test is in file mirrors_lookup_test.dart
17 var file = new File('test.dart'); 16 var file = new File('test.dart');
18 file.writeAsStringSync(''' 17 file.writeAsStringSync('''
19 library test; 18 library test;
20 /** 19 /**
21 * Doc comment for class [A]. 20 * Doc comment for class [A].
22 * 21 *
23 * Multiline Test 22 * Multiline Test
24 */ 23 */
25 /* 24 /*
26 * Normal comment for class A. 25 * Normal comment for class A.
(...skipping 13 matching lines...) Expand all
40 print(A); 39 print(A);
41 } 40 }
42 } 41 }
43 42
44 main() { 43 main() {
45 A a = new A(); 44 A a = new A();
46 a.doThis(5); 45 a.doThis(5);
47 } 46 }
48 '''); 47 ''');
49 48
50 getMirrorSystem(['test.dart'],'', parseSdk: false) 49 getMirrorSystem(['test.dart'])
51 .then(expectAsync1((mirrorSystem) { 50 .then(expectAsync1((mirrorSystem) {
52 var testLibraryUri = currentDirectory.resolve('test.dart'); 51 var testLibraryUri = new Uri(scheme: 'file',
52 path: path.absolute('test.dart'));
53 var library = generateLibrary(mirrorSystem.libraries[testLibraryUri], 53 var library = generateLibrary(mirrorSystem.libraries[testLibraryUri],
54 includePrivate: true); 54 includePrivate: false);
55 expect(library is Library, isTrue); 55 expect(library is Library, isTrue);
56 56
57 var classTypes = library.classes.values; 57 var classTypes = library.classes.values;
58 expect(classTypes.every((e) => e is Map), isTrue); 58 expect(classTypes.every((e) => e is Map), isTrue);
59 59
60 var classes = []; 60 var classes = [];
61 classTypes.forEach((e) => classes.addAll(e.values)); 61 classTypes.forEach((e) => classes.addAll(e.values));
62 expect(classes.every((e) => e is Class), isTrue); 62 expect(classes.every((e) => e is Class), isTrue);
63 63
64 var classMethodTypes = []; 64 var classMethodTypes = [];
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 // Testing trying to refer to doThis function 108 // Testing trying to refer to doThis function
109 var methodDocComment = fixReference('doThis', libraryMirror, 109 var methodDocComment = fixReference('doThis', libraryMirror,
110 classMirror, methodMirror).children.first.text; 110 classMirror, methodMirror).children.first.text;
111 expect(methodDocComment == 'test.A.doThis', isTrue); 111 expect(methodDocComment == 'test.A.doThis', isTrue);
112 112
113 // Testing something with no reference 113 // Testing something with no reference
114 var libraryDocComment = fixReference('foobar', libraryMirror, 114 var libraryDocComment = fixReference('foobar', libraryMirror,
115 classMirror, methodMirror).children.first.text; 115 classMirror, methodMirror).children.first.text;
116 expect(libraryDocComment == 'foobar', isTrue); 116 expect(libraryDocComment == 'foobar', isTrue);
117 117
118 file.deleteSync(); 118 Directory.current = current;
119 temporaryDir.deleteSync(recursive: true);
119 })); 120 }));
120 }); 121 });
121 }); 122 });
122 } 123 }
OLDNEW
« no previous file with comments | « pkg/docgen/lib/docgen.dart ('k') | pkg/pkg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698