Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 394cf0d

Browse files
committed
made the negative test more specific
1 parent 06daf81 commit 394cf0d

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

tools/clang_tidy/test/clang_tidy_test.dart

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,13 +140,19 @@ void _withTempFile(String prefix, void Function(String path) func) {
140140
});
141141

142142
test('shard-id invalid', () async {
143-
final String variant = path.basename(io.File(buildCommands).parent.path);
144-
final Options options = Options.fromCommandLine( <String>[
145-
'--shard-variants=$variant',
146-
'--shard-id=2',
147-
],);
143+
final StringBuffer errBuffer = StringBuffer();
144+
final Options options = Options.fromCommandLine(<String>[
145+
'--shard-variants=variant',
146+
'--shard-id=2',
147+
], errSink: errBuffer);
148148
expect(options.errorMessage, isNotNull);
149149
expect(options.shardId, isNull);
150+
print('foo ${options.errorMessage}');
151+
expect(
152+
options.errorMessage,
153+
contains(
154+
'Invalid shard-id value',
155+
));
150156
});
151157

152158
test('Error when --compile-commands path does not exist', () async {

0 commit comments

Comments
 (0)