Chromium Code Reviews| 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) { |