Add a "variant: " prefix to variant descriptions in test names (#86701)
This commit is contained in:
parent
7d026b6b8b
commit
91b67e8eb1
@ -149,7 +149,13 @@ void testWidgets(
|
||||
final WidgetTester tester = WidgetTester._(binding);
|
||||
for (final dynamic value in variant.values) {
|
||||
final String variationDescription = variant.describeValue(value);
|
||||
final String combinedDescription = variationDescription.isNotEmpty ? '$description ($variationDescription)' : description;
|
||||
// IDEs may make assumptions about the format of this suffix in order to
|
||||
// support running tests directly from the editor (where they may have
|
||||
// access to only the test name, provided by the analysis server).
|
||||
// See https://github.com/flutter/flutter/issues/86659.
|
||||
final String combinedDescription = variationDescription.isNotEmpty
|
||||
? '$description (variant: $variationDescription)'
|
||||
: description;
|
||||
test(
|
||||
combinedDescription,
|
||||
() {
|
||||
|
@ -697,7 +697,10 @@ void main() {
|
||||
if (debugDefaultTargetPlatformOverride == null) {
|
||||
expect(tester.testDescription, equals('variant tests have descriptions with details'));
|
||||
} else {
|
||||
expect(tester.testDescription, equals('variant tests have descriptions with details ($debugDefaultTargetPlatformOverride)'));
|
||||
expect(
|
||||
tester.testDescription,
|
||||
equals('variant tests have descriptions with details (variant: $debugDefaultTargetPlatformOverride)'),
|
||||
);
|
||||
}
|
||||
}, variant: TargetPlatformVariant(TargetPlatform.values.toSet()));
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user