dart format

This commit is contained in:
2026-05-08 20:12:40 +02:00
parent 9e139b5704
commit 3b8da1d3d6
295 changed files with 6404 additions and 4161 deletions
+26 -16
View File
@@ -14,27 +14,33 @@ void main() {
seenBusyInsideCallback = controller.busy;
});
expect(seenBusyInsideCallback, isTrue,
reason: 'busy must be true while the callback is running');
expect(
seenBusyInsideCallback,
isTrue,
reason: 'busy must be true while the callback is running',
);
expect(ok, isTrue);
expect(controller.busy, isFalse);
expect(controller.error, isNull);
});
test('captures mapped error message on failure and returns false', () async {
final controller = AsyncActionController();
addTearDown(controller.dispose);
test(
'captures mapped error message on failure and returns false',
() async {
final controller = AsyncActionController();
addTearDown(controller.dispose);
final ok = await controller.run(
() async => throw Exception('boom'),
errorBuilder: (e) => 'custom: $e',
);
final ok = await controller.run(
() async => throw Exception('boom'),
errorBuilder: (e) => 'custom: $e',
);
expect(ok, isFalse);
expect(controller.busy, isFalse);
expect(controller.error, contains('custom:'));
expect(controller.error, contains('boom'));
});
expect(ok, isFalse);
expect(controller.busy, isFalse);
expect(controller.error, contains('custom:'));
expect(controller.error, contains('boom'));
},
);
test('rejects re-entry while busy', () async {
final controller = AsyncActionController();
@@ -51,8 +57,12 @@ void main() {
expect(controller.busy, isTrue);
final reentrant = await controller.run(() async {});
expect(reentrant, isFalse,
reason: 'second run while busy must be rejected without invoking callback');
expect(
reentrant,
isFalse,
reason:
'second run while busy must be rejected without invoking callback',
);
firstCanFinish.complete();
expect(await firstFuture, isTrue);