| Index: pkg/docgen/test/only_lib_content_in_pkg_test.dart
|
| diff --git a/pkg/docgen/test/only_lib_content_in_pkg_test.dart b/pkg/docgen/test/only_lib_content_in_pkg_test.dart
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..6df4a746ef3b8248d65ed85ccca8d34f407aef3c
|
| --- /dev/null
|
| +++ b/pkg/docgen/test/only_lib_content_in_pkg_test.dart
|
| @@ -0,0 +1,50 @@
|
| +// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
|
| +// for details. All rights reserved. Use of this source code is governed by a
|
| +// BSD-style license that can be found in the LICENSE file.
|
| +
|
| +library docgen.test.only_lib_content_in_pkg;
|
| +
|
| +import 'dart:io';
|
| +
|
| +import 'package:path/path.dart' as p;
|
| +import 'package:scheduled_test/descriptor.dart' as d;
|
| +import 'package:scheduled_test/scheduled_test.dart';
|
| +import 'package:unittest/matcher.dart';
|
| +
|
| +import '../lib/docgen.dart' as dg;
|
| +import 'util.dart';
|
| +
|
| +void main() {
|
| +
|
| + setUp(() {
|
| + scheduleTempDir();
|
| + });
|
| +
|
| + test('exclude non-lib code from package docs', () {
|
| + schedule(() {
|
| + var thisScript = Platform.script;
|
| + var thisPath = p.fromUri(thisScript);
|
| + expect(p.basename(thisPath), 'only_lib_content_in_pkg_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();
|
| +
|
| + });
|
| +}
|
|
|