Unverified Commit 91b67e8e authored by Danny Tuppeny's avatar Danny Tuppeny Committed by GitHub

Add a "variant: " prefix to variant descriptions in test names (#86701)

parent 7d026b6b
......@@ -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()));
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment