test/random_test library

Functions

testRandom(String name, void body(Random random), {int? seed, String? testOn, Timeout? timeout, dynamic skip, dynamic tags, Map<String, dynamic>? onPlatform, int? retry, int repeatCount = 1}) → void
This function is equivalent to test(name, body), except that it is better suited for randomized testing: it will create a Random generator and pass it to the test body, but also record the seed that was used for creating the random generator. Thus, if a test fails for a specific rare seed, it would be easy to reproduce this failure.
testWidgetsRandom(String description, TestWidgetsCallback callback, {int? seed, bool? skip, Timeout? timeout, bool semanticsEnabled = true, dynamic tags}) → void
This function is equivalent to testWidgets(name, body), except that it is better suited for randomized testing: it will create a Random generator and pass it to the test body, but also record the seed that was used for creating the random generator. Thus, if a test fails for a specific rare seed, it would be easy to reproduce this failure.

Typedefs

TestWidgetsCallback = Future<void> Function(Random random, WidgetTester widgetTester)