Skip to content
This repository has been archived by the owner on Oct 17, 2024. It is now read-only.

Dart format with latest SDK #189

Merged
merged 1 commit into from
Jul 12, 2021
Merged
Show file tree
Hide file tree
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
5 changes: 4 additions & 1 deletion test/reject_errors_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ void main() {
});

test('passes through data events', () {
controller.sink.rejectErrors()..add(1)..add(2)..add(3);
controller.sink.rejectErrors()
..add(1)
..add(2)
..add(3);
expect(controller.stream, emitsInOrder([1, 2, 3]));
});

Expand Down
6 changes: 5 additions & 1 deletion test/stream_completer_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ void main() {
var done = subscription.asFuture();
subscription.pause();
var sourceController = StreamController();
sourceController..add(1)..add(2)..add(3)..add(4);
sourceController
..add(1)
..add(2)
..add(3)
..add(4);
controller.setSourceStream(sourceController.stream);
await flushMicrotasks();
expect(sourceController.hasListener, isTrue);
Expand Down
20 changes: 16 additions & 4 deletions test/stream_sink_completer_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ void main() {
test('data events are forwarded', () {
var sink = TestSink();
completer.setDestinationSink(sink);
completer.sink..add(1)..add(2)..add(3)..add(4);
completer.sink
..add(1)
..add(2)
..add(3)
..add(4);

expect(sink.results[0].asValue!.value, equals(1));
expect(sink.results[1].asValue!.value, equals(2));
Expand All @@ -30,7 +34,9 @@ void main() {
test('error events are forwarded', () {
var sink = TestSink();
completer.setDestinationSink(sink);
completer.sink..addError('oh no')..addError("that's bad");
completer.sink
..addError('oh no')
..addError("that's bad");

expect(sink.results[0].asError!.error, equals('oh no'));
expect(sink.results[1].asError!.error, equals("that's bad"));
Expand Down Expand Up @@ -114,7 +120,11 @@ void main() {

group('when a stream is linked after events are added', () {
test('data events are forwarded', () async {
completer.sink..add(1)..add(2)..add(3)..add(4);
completer.sink
..add(1)
..add(2)
..add(3)
..add(4);
await flushMicrotasks();

var sink = TestSink();
Expand All @@ -128,7 +138,9 @@ void main() {
});

test('error events are forwarded', () async {
completer.sink..addError('oh no')..addError("that's bad");
completer.sink
..addError('oh no')
..addError("that's bad");
await flushMicrotasks();

var sink = TestSink();
Expand Down
21 changes: 17 additions & 4 deletions test/stream_zip_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -210,15 +210,26 @@ void main() {
expect(
StreamZip([
streamError(mks([1, 2, 3, 4]), 4, 'BAD-5'),
(StreamController()..add(4)..add(5)..add(6)).stream,
(StreamController()..add(7)..add(8)..add(9)).stream
(StreamController()
..add(4)
..add(5)
..add(6))
.stream,
(StreamController()
..add(7)
..add(8)
..add(9))
.stream
]).toList(),
throwsA(equals('BAD-5')));
});

test('Error after first end', () {
var controller = StreamController();
controller..add(7)..add(8)..add(9);
controller
..add(7)
..add(8)
..add(9);
// Transformer that puts error into controller when one of the first two
// streams have sent a done event.
var trans =
Expand Down Expand Up @@ -298,7 +309,9 @@ void main() {
..add(5)
..add(7)
..close();
c2..add(2)..add(4);
c2
..add(2)
..add(4);
});

test('pause-resume2', () {
Expand Down