Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions test/disposable_bag_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,30 @@ void main() {
check(calls).deepEquals(['a', 'c']);
});
});

group('DisposableBagException', () {
test('toString formats single error correctly', () {
final exception = DisposableBagException([
Exception('error 1'),
]);

check(exception.toString()).equals(
'DisposableBagException: 1 disposer(s) threw errors:\n'
' - Exception: error 1',
);
});

test('toString formats multiple errors correctly', () {
final exception = DisposableBagException([
Exception('first error'),
'second error',
]);

check(exception.toString()).equals(
'DisposableBagException: 2 disposer(s) threw errors:\n'
' - Exception: first error\n'
' - second error',
);
});
});
}