Skip to content

Commit

Permalink
dart-lang#2119. Remove unsupported element from ReceivePort.first/las…
Browse files Browse the repository at this point in the history
…tWhere tests description (dart-lang#2541)
  • Loading branch information
sgrekhov committed Feb 15, 2024
1 parent 478e635 commit 78361d4
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 63 deletions.
20 changes: 9 additions & 11 deletions LibTest/isolate/ReceivePort/firstWhere_A01_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,21 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

/// @assertion Future<T> firstWhere (bool test(T element), {
/// @deprecated dynamic defaultValue(), T orElse()})
/// @assertion Future<T> firstWhere(bool test(T element), {T orElse()?})
///
/// Finds the first element of this stream matching test.
///
/// Returns a future that is completed with the first element of this stream that
/// test returns true for.
/// Returns a future that is completed with the first element of this stream for
/// which test returns true.
///
/// If no such element is found before this stream is done, and a orElse function
/// is provided, the result of calling orElse becomes the value of the future. If
/// orElse throws, the returned future is completed with that error.
/// If no such element is found before this stream is done, and an orElse
/// function is provided, the result of calling orElse becomes the value of the
/// future. If orElse throws, the returned future is completed with that error.
///
/// If this stream emits an error before the first matching element, the returned
/// future is completed with that error, and processing stops.
/// If this stream emits an error before the first matching element, the
/// returned future is completed with that error, and processing stops.
///
/// Stops listening to the stream after the first matching element or error has
/// Stops listening to this stream after the first matching element or error has
/// been received.
///
/// Internally the method cancels its subscription after the first element that
Expand All @@ -27,7 +26,6 @@
/// If an error occurs, or if this stream ends without finding a match and with
/// no orElse function provided, the returned future is completed with an error.
///
/// The defaultValue parameter is deprecated, and orElse should be used instead.
/// @description Checks that if element is found, it is passed to the resulting
/// future.
/// @author kaigorodov
Expand Down
24 changes: 11 additions & 13 deletions LibTest/isolate/ReceivePort/firstWhere_A02_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,21 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

/// @assertion Future<T> firstWhere (bool test(T element), {
/// @deprecated dynamic defaultValue(), T orElse()})
/// @assertion Future<T> firstWhere(bool test(T element), {T orElse()?})
///
/// Finds the first element of this stream matching test.
///
/// Returns a future that is completed with the first element of this stream that
/// test returns true for.
/// Returns a future that is completed with the first element of this stream for
/// which test returns true.
///
/// If no such element is found before this stream is done, and a orElse function
/// is provided, the result of calling orElse becomes the value of the future. If
/// orElse throws, the returned future is completed with that error.
/// If no such element is found before this stream is done, and an orElse
/// function is provided, the result of calling orElse becomes the value of the
/// future. If orElse throws, the returned future is completed with that error.
///
/// If this stream emits an error before the first matching element, the returned
/// future is completed with that error, and processing stops.
/// If this stream emits an error before the first matching element, the
/// returned future is completed with that error, and processing stops.
///
/// Stops listening to the stream after the first matching element or error has
/// Stops listening to this stream after the first matching element or error has
/// been received.
///
/// Internally the method cancels its subscription after the first element that
Expand All @@ -27,10 +26,9 @@
/// If an error occurs, or if this stream ends without finding a match and with
/// no orElse function provided, the returned future is completed with an error.
///
/// The defaultValue parameter is deprecated, and orElse should be used instead.
/// @description Checks that if this stream ends without finding a match and a
/// [orElse] function is provided, the result of calling [orElse]
/// becomes the value of the future.
/// [orElse] function is provided, the result of calling [orElse] becomes the
/// value of the future.
/// @author kaigorodov
import "dart:async";
Expand Down
24 changes: 11 additions & 13 deletions LibTest/isolate/ReceivePort/firstWhere_A03_t02.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,21 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

/// @assertion Future<T> firstWhere (bool test(T element), {
/// @deprecated dynamic defaultValue(), T orElse()})
/// @assertion Future<T> firstWhere(bool test(T element), {T orElse()?})
///
/// Finds the first element of this stream matching test.
///
/// Returns a future that is completed with the first element of this stream that
/// test returns true for.
/// Returns a future that is completed with the first element of this stream for
/// which test returns true.
///
/// If no such element is found before this stream is done, and a orElse function
/// is provided, the result of calling orElse becomes the value of the future. If
/// orElse throws, the returned future is completed with that error.
/// If no such element is found before this stream is done, and an orElse
/// function is provided, the result of calling orElse becomes the value of the
/// future. If orElse throws, the returned future is completed with that error.
///
/// If this stream emits an error before the first matching element, the returned
/// future is completed with that error, and processing stops.
/// If this stream emits an error before the first matching element, the
/// returned future is completed with that error, and processing stops.
///
/// Stops listening to the stream after the first matching element or error has
/// Stops listening to this stream after the first matching element or error has
/// been received.
///
/// Internally the method cancels its subscription after the first element that
Expand All @@ -27,9 +26,8 @@
/// If an error occurs, or if this stream ends without finding a match and with
/// no orElse function provided, the returned future is completed with an error.
///
/// The defaultValue parameter is deprecated, and orElse should be used instead.
/// @description Checks that if this stream ends without finding a match and with
/// no [orElse] function provided, the future will receive an error.
/// @description Checks that if this stream ends without finding a match and
/// with no [orElse] function provided, the future will receive an error.
/// @author kaigorodov
import "dart:async";
Expand Down
22 changes: 14 additions & 8 deletions LibTest/isolate/ReceivePort/lastWhere_A01_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,25 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

/// @assertion Future<T> lastWhere (bool test(T element),
/// {@deprecated dynamic defaultValue(), T orElse()})
/// @assertion Future<T> lastWhere(bool test(T element), {T orElse()?})
///
/// Finds the last element in this stream matching test.
///
/// If this stream emits an error, the returned future is completed with that
/// error, and processing stops.
/// Returns a future that is completed with the last element of this stream for
/// which test returns true.
///
/// Otherwise as firstWhere, except that the last matching element is found
/// instead of the first. That means that a non-error result cannot be provided
/// before this stream is done.
/// If no such element is found before this stream is done, and an orElse
/// function is provided, the result of calling orElse becomes the value of the
/// future. If orElse throws, the returned future is completed with that error.
///
/// If this stream emits an error at any point, the returned future is completed
/// with that error, and the subscription is canceled.
///
/// A non-error result cannot be provided before this stream is done.
///
/// Similar too firstWhere, except that the last matching element is found
/// instead of the first.
///
/// The defaultValue parameter is deprecated, and orElse should be used instead.
/// @description Checks that if element is found, it is passed to the resulting
/// future.
/// @author kaigorodov
Expand Down
22 changes: 14 additions & 8 deletions LibTest/isolate/ReceivePort/lastWhere_A02_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,25 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

/// @assertion Future<T> lastWhere (bool test(T element),
/// {@deprecated dynamic defaultValue(), T orElse()})
/// @assertion Future<T> lastWhere(bool test(T element), {T orElse()?})
///
/// Finds the last element in this stream matching test.
///
/// If this stream emits an error, the returned future is completed with that
/// error, and processing stops.
/// Returns a future that is completed with the last element of this stream for
/// which test returns true.
///
/// Otherwise as firstWhere, except that the last matching element is found
/// instead of the first. That means that a non-error result cannot be provided
/// before this stream is done.
/// If no such element is found before this stream is done, and an orElse
/// function is provided, the result of calling orElse becomes the value of the
/// future. If orElse throws, the returned future is completed with that error.
///
/// If this stream emits an error at any point, the returned future is completed
/// with that error, and the subscription is canceled.
///
/// A non-error result cannot be provided before this stream is done.
///
/// Similar too firstWhere, except that the last matching element is found
/// instead of the first.
///
/// The defaultValue parameter is deprecated, and orElse should be used instead.
/// @description Checks that if this stream ends without finding a match and an
/// [orElse] function is provided, the result of calling [orElse] becomes the
/// value of the future.
Expand Down
26 changes: 16 additions & 10 deletions LibTest/isolate/ReceivePort/lastWhere_A04_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,27 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

/// @assertion Future<T> lastWhere (bool test(T element),
/// {@deprecated dynamic defaultValue(), T orElse()})
/// @assertion Future<T> lastWhere(bool test(T element), {T orElse()?})
///
/// Finds the last element in this stream matching test.
///
/// If this stream emits an error, the returned future is completed with that
/// error, and processing stops.
/// Returns a future that is completed with the last element of this stream for
/// which test returns true.
///
/// Otherwise as firstWhere, except that the last matching element is found
/// instead of the first. That means that a non-error result cannot be provided
/// before this stream is done.
/// If no such element is found before this stream is done, and an orElse
/// function is provided, the result of calling orElse becomes the value of the
/// future. If orElse throws, the returned future is completed with that error.
///
/// The defaultValue parameter is deprecated, and orElse should be used instead.
/// @description Checks that if this stream ends without finding a match and with
/// no [orElse] function provided, the future will receive an error.
/// If this stream emits an error at any point, the returned future is completed
/// with that error, and the subscription is canceled.
///
/// A non-error result cannot be provided before this stream is done.
///
/// Similar too firstWhere, except that the last matching element is found
/// instead of the first.
///
/// @description Checks that if this stream ends without finding a match and
/// with no [orElse] function provided, the future will receive an error.
/// @author kaigorodov
import "dart:async";
Expand Down

0 comments on commit 78361d4

Please sign in to comment.