You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please notice that openRead().listen(...) returns a StreamSubscription object. The entire openRead().listen(...).onDone() expression returns void according to the documention.
There is therefore no point in await ...ing this expression.
Though now the question comes up what this test is actually testing. The Expect.throws(() {file.deleteSync();}); statement expects that the file cannot be deleted while we are getting data. This is not the case on most platforms. For one, the data we get might be the last, so we might have already gotten the EOF (end-of-file). Furthermore on platforms like linux one can easily open a file, someone deletes the file, and we can continue reading from it (this works until the last file open file descriptor is droped, then the file is actually deleted).
From LibTest/io/File/openRead_A02_t01.dart:
Please notice that
openRead().listen(...)
returns aStreamSubscription
object. The entireopenRead().listen(...).onDone()
expression returnsvoid
according to the documention.There is therefore no point in
await ...
ing this expression.Instead one could use a Completer:
Though now the question comes up what this test is actually testing. The
Expect.throws(() {file.deleteSync();});
statement expects that the file cannot be deleted while we are getting data. This is not the case on most platforms. For one, the data we get might be the last, so we might have already gotten the EOF (end-of-file). Furthermore on platforms like linux one can easily open a file, someone deletes the file, and we can continue reading from it (this works until the last file open file descriptor is droped, then the file is actually deleted).@dcharkes
The text was updated successfully, but these errors were encountered: