Skip to content

Commit 1f939fa

Browse files
committed
Add test for doc generation presence/absence with --quiet
1 parent 8e41406 commit 1f939fa

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/dartdoc_test.dart

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,22 @@ void main() {
143143
expect(outputLines, contains(matches('^ warning:')));
144144
expect(
145145
outputLines.last, matches(r'^found \d+ warnings and \d+ errors'));
146+
expect(outputDir.listSync(), isEmpty);
147+
});
148+
149+
test('running --quiet is quiet and does generate docs',
150+
() async {
151+
Directory outputDir =
152+
await Directory.systemTemp.createTemp('dartdoc.testEmpty.');
153+
List<String> outputLines = [];
154+
await subprocessLauncher.runStreamed(Platform.resolvedExecutable,
155+
[dartdocPath, '--output', outputDir.path, '--quiet'],
156+
perLine: outputLines.add, workingDirectory: _testPackagePath);
157+
expect(outputLines, isNot(contains(matches('^parsing'))));
158+
expect(outputLines, contains(matches('^ warning:')));
159+
expect(
160+
outputLines.last, matches(r'^found \d+ warnings and \d+ errors'));
161+
expect(outputDir.listSync(), isNotEmpty);
146162
});
147163

148164
test('invalid parameters return non-zero and print a fatal-error',

0 commit comments

Comments
 (0)