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

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

Issue 83173012: Fix docgen Uri handling so it works on Windows. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix test so it passes Uri of the file rather than string filename. Created 7 years 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 const String DART_LIBRARY = ''' 10 const String DART_LIBRARY = '''
(...skipping 28 matching lines...) Expand all
39 } 39 }
40 '''; 40 ''';
41 41
42 main() { 42 main() {
43 group('Generate docs for', () { 43 group('Generate docs for', () {
44 test('one simple file.', () { 44 test('one simple file.', () {
45 var temporaryDir = Directory.systemTemp.createTempSync('single_library_'); 45 var temporaryDir = Directory.systemTemp.createTempSync('single_library_');
46 var fileName = path.join(temporaryDir.path, 'temp.dart'); 46 var fileName = path.join(temporaryDir.path, 'temp.dart');
47 var file = new File(fileName); 47 var file = new File(fileName);
48 file.writeAsStringSync(DART_LIBRARY); 48 file.writeAsStringSync(DART_LIBRARY);
49 getMirrorSystem([fileName]) 49 getMirrorSystem([new Uri.file(fileName)])
50 .then(expectAsync1((mirrorSystem) { 50 .then(expectAsync1((mirrorSystem) {
51 var testLibraryUri = new Uri(scheme: 'file', 51 var testLibraryUri = new Uri(scheme: 'file',
52 path: path.absolute(fileName)); 52 path: path.absolute(fileName));
53 var library = generateLibrary(mirrorSystem.libraries[testLibraryUri]); 53 var library = generateLibrary(mirrorSystem.libraries[testLibraryUri]);
54 expect(library is Library, isTrue); 54 expect(library is Library, isTrue);
55 55
56 var classTypes = library.classes; 56 var classTypes = library.classes;
57 expect(classTypes is ClassGroup, isTrue); 57 expect(classTypes is ClassGroup, isTrue);
58 58
59 var classes = []; 59 var classes = [];
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 expect(methodDocComment == 'test.A.doThis', isTrue); 127 expect(methodDocComment == 'test.A.doThis', isTrue);
128 128
129 // Testing something with no reference 129 // Testing something with no reference
130 var libraryDocComment = fixReference('foobar', libraryMirror, 130 var libraryDocComment = fixReference('foobar', libraryMirror,
131 classMirror, methodMirror).text; 131 classMirror, methodMirror).text;
132 expect(libraryDocComment == 'foobar', isTrue); 132 expect(libraryDocComment == 'foobar', isTrue);
133 })).whenComplete(() => temporaryDir.deleteSync(recursive: true)); 133 })).whenComplete(() => temporaryDir.deleteSync(recursive: true));
134 }); 134 });
135 }); 135 });
136 } 136 }
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