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

Unified Diff: pkg/docgen/test/single_library_test.dart

Issue 19695013: "Reverting 25378" (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/docgen/lib/docgen.dart ('k') | pkg/pkg.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/docgen/test/single_library_test.dart
diff --git a/pkg/docgen/test/single_library_test.dart b/pkg/docgen/test/single_library_test.dart
index 8aeefdbcc26acc6e9ddc92e0ceecd8ff9ceae8bf..6ff153985dd11b6f93fecf6594a9c88860c435a1 100644
--- a/pkg/docgen/test/single_library_test.dart
+++ b/pkg/docgen/test/single_library_test.dart
@@ -2,17 +2,19 @@ library single_library_test;
import 'dart:io';
-import 'package:path/path.dart' as path;
import 'package:unittest/unittest.dart';
import '../lib/docgen.dart';
+import '../../../sdk/lib/_internal/compiler/implementation/filenames.dart';
main() {
group('Generate docs for', () {
test('one simple file.', () {
- var temporaryDir = new Directory('single_library').createTempSync();
- var fileName = path.join(temporaryDir.path, 'temp.dart');
- var file = new File(fileName);
+ // TODO(janicejl): Instead of creating a new file, should use an in-memory
+ // file for creating the mirrorSystem. Example of the util function in
+ // sdk/lib/_internal/compiler/implementation/mirrors/mirrors_util.dart.
+ // Example of the test is in file mirrors_lookup_test.dart
+ var file = new File('test.dart');
file.writeAsStringSync('''
library test;
/**
@@ -45,12 +47,11 @@ main() {
}
''');
- getMirrorSystem([fileName])
+ getMirrorSystem(['test.dart'],'', parseSdk: false)
.then(expectAsync1((mirrorSystem) {
- var testLibraryUri = new Uri(scheme: 'file',
- path: path.absolute(fileName));
+ var testLibraryUri = currentDirectory.resolve('test.dart');
var library = generateLibrary(mirrorSystem.libraries[testLibraryUri],
- includePrivate: false);
+ includePrivate: true);
expect(library is Library, isTrue);
var classTypes = library.classes.values;
@@ -114,7 +115,7 @@ main() {
classMirror, methodMirror).children.first.text;
expect(libraryDocComment == 'foobar', isTrue);
- temporaryDir.deleteSync(recursive: true);
+ file.deleteSync();
}));
});
});
« 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