Skip to content

Wrong File.openRead() test rewritten #207

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

Merged
merged 2 commits into from
Dec 17, 2018
Merged

Wrong File.openRead() test rewritten #207

merged 2 commits into from
Dec 17, 2018

Conversation

sgrekhov
Copy link
Contributor

Test was rewrittent to test that returned stream can be listened to

final c = new Completer();
StreamSubscription<List<int>> s = null;
s = await file.openRead().listen((data) async {
Expect.listEquals([1, 2, 3], data);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The callback given to listen((data) {... }) can be called multiple times, each with a subset of the bytes. There is no guarantee that the very first time we get all 3 bytes, consider changing this to expect that data is a prefix of [1, 2, 3]

@sgrekhov sgrekhov merged commit 5b0b8ff into master Dec 17, 2018
@sgrekhov sgrekhov deleted the issue206 branch September 17, 2019 06:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants