-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#2933. Add tests for Stream.multi
constructor.
#2935
base: master
Are you sure you want to change the base?
Conversation
stream.listen((v) { | ||
Expect.equals(v, i++); | ||
}, onDone: () { | ||
asyncEnd(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe check here that i
is 6. Ditto for j
below.
|
||
stream.listen((v) {}, onDone: () { | ||
stream.listen((v) {}, onDone: () { | ||
Expect.notEquals(c1, c2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd use notIdentical
.
They're probably not equal, but we don't actually specify what ==
does. (That usually means it's the same as identical
, but ... sometimes it's not. Like StreamController.broadcast().stream
which returns distinct but equal values each time.)
|
||
stream.listen((v) {}, onDone: () { | ||
asyncEnd(); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Can be written as onDone: asyncEnd
.)
/// all current listeners, it behaves like a broadcast stream. | ||
/// | ||
/// @description Checks that reading of [MultiStreamController.stream] is not | ||
/// supported. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description not updated for this test?
(Same as for A03_t01.)
main() { | ||
asyncStart(); | ||
var stream = Stream<int>.multi((MultiStreamController<int> controller) { | ||
print(controller.hasListener); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test true or false? I think it's true
. Also not paused, even though you can't send synchronous events before the call to listen
has returned.
controller.close(); | ||
}, isBroadcast: true); | ||
Expect.isTrue(stream.isBroadcast); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing below here is needed for the test.
Are there tests for the |
No description provided.