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

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

Issue 196963003: pkg/docgen: dir that look like packages, only document the contents of lib (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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
Index: pkg/docgen/test/generate_json_test.dart
diff --git a/pkg/docgen/test/generate_json_test.dart b/pkg/docgen/test/generate_json_test.dart
index afb32feea5eabcdeaa4a5e4e5cdffd10a0fe5172..da11e2409fcc980c27205f112fd13a051aadddc9 100644
--- a/pkg/docgen/test/generate_json_test.dart
+++ b/pkg/docgen/test/generate_json_test.dart
@@ -93,6 +93,34 @@ void main() {
expect(comparator['comment'], expectedComment);
});
});
+
+ test('exclude non-lib code from package docs', () {
kevmoo 2014/03/17 20:28:33 Ensure that test libs in the docgen package don't
+ schedule(() {
+ var thisScript = Platform.script;
+ var thisPath = p.fromUri(thisScript);
+ expect(p.basename(thisPath), 'generate_json_test.dart');
+ expect(p.dirname(thisPath), endsWith('test'));
+
+
+ var codeDir = p.normalize(p.join(thisPath, '..', '..'));
+ print(codeDir);
+ expect(FileSystemEntity.isDirectorySync(codeDir), isTrue);
+ return dg.docgen(['$codeDir/'], out: p.join(d.defaultRoot, 'docs'));
+ });
+
+ d.dir('docs', [
+ d.dir('docgen', [
+ d.matcherFile('docgen.json', _isJsonMap)
+ ]),
+ d.matcherFile('index.json', _isJsonMap),
+ d.matcherFile('index.txt', _hasSortedLines),
+ d.matcherFile('library_list.json', _isJsonMap),
+ d.nothing('test_lib.json'),
+ d.nothing('test_lib-bar.json'),
+ d.nothing('test_lib-foo.json')
+ ]).validate();
+
+ });
}
final Matcher _hasSortedLines = predicate((String input) {

Powered by Google App Engine
This is Rietveld 408576698