Commit Graph

50 Commits

Author SHA1 Message Date
Lasse R.H. Nielsen 6fe105671c Remove var and final from parameters in test/.
Not removing from any file with a language marker.
Also not touching anything in `tests/language/primary_constructors`
or `.../private_named_parameters`, which are both assumed to be
primary constructor feature aware.

Two files rewritten from multi-test to error-test.

Change-Id: I43d444a35a41c7734f266794e9f167655692473f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/480640
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2026-02-17 08:28:57 -08:00
Robert Nystrom d3904f5a54 Reformat tests/lib/async/** using 3.8 style.
Change-Id: I6ccbe1494165c2bda142ece13584c4738e3b43e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425347
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2025-05-02 04:08:54 -07:00
Lasse R.H. Nielsen f8086c81ae Collect all test-related files in package:expect.
Collects files from `package:async_helper` and `tests/language`
that are generally useful, so that all test-related helpers are
in `package:expect`.

Moves the two libraries from `package:async_helper` into `package:expect`,
and the `tests/language/static_type_helper.dart` file too.

Deprecates `async_minitest.dart`, to follow `minitest.dart`,
expecting the Flutter use of it to have been fixed to not break
on deprecation (I believe Flutter no longer breaks builds on deprecations at all).

Patch 1 is the actual change.
Patch 2+4+8 is changing all existing references to the files.
Patch 6 ignores deprecation in files still using `async_minitest.dart`.

3+5+7+9 are updating this text to make the numbers match.
Then it's just test-expectations and small tweaks from there.

Change-Id: I1b665135b5fef9b9a0c3b340ffe9daf874d0174c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373120
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2024-10-11 16:53:52 +00:00
Robert Nystrom a2b556b937 Migrate lib_2/async to NNBD.
Change-Id: Ia5c41dda6503e1fbb8cc6099835d07588425e2ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128310
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-01-09 22:04:37 +00:00
Bob Nystrom f6ca2c1d8f Remove the Dart 1 tests.
This deletes:

tests/co19
tests/corelib
tests/html
tests/isolate
tests/language
tests/lib

It does not delete tests/standalone because apparently there are tests
in there that are not in standalone_2. (I assume they were added after
the test migration. I don't know why they were added there.)

I have tried to remove references to the old tests from various scripts
and tools but may have missed some. (As you can imagine, grepping for
"lib" does not have the best signal-to-noise ratio.)

"It was a pleasure to burn. It was a special pleasure to see things
eaten, to see things blackened and changed. With the brass nozzle in his
fists, with this great python spitting its venomous kerosene upon the
world, the blood pounded in his head, and his hands were the hands of
some amazing conductor playing all the symphonies of blazing and burning
to bring down the tatters and charcoal ruins of history."

- Ray Bradbury, Fahrenheit 451

Change-Id: If3db4a50e7a5ee25aff8058b1483e2ce8e68424e
Reviewed-on: https://dart-review.googlesource.com/c/75420
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Terry Lucas <terry@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-10-11 23:45:18 +00:00
Jacob Richman 2dcd56ef43 Format all tests.
There are far too many files here to review everyone carefully.
Spot checking most of the diffs look good as test code is generally written
with less care than application code so lots of ugly formatting get through.
If people notice files where the automated formatting bothers them feel free
to comment indicating file names and I'll move spaces within comments to make
the formatting cleaner and use comments to force block formatting as I have
done for other case where formatting looked bad.

BUG=
R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2771453003 .
2017-04-17 14:53:02 -07:00
Florian Loitsch 6255638cd0 Return futures on Stream.cancel when possible.
Deprecate returning `null`.

Also, fixes cases where transformations on a stream didn't forward the cancel future

Fixes #26777.

BUG= http://dartbug.com/26777.
R=lrn@google.com

Review URL: https://codereview.chromium.org/2202533003 .

Committed: https://github.com/dart-lang/sdk/commit/395e7aaa696126b82862a9f75e7ebf742c354b56
Reverted: https://github.com/dart-lang/sdk/commit/99e5328eaca7f98641a5c6e523e80b7297792817
Committed: https://github.com/dart-lang/sdk/commit/1905ddafaa242883891e2fb2d706e2dfa059a71b
Reverted: https://github.com/dart-lang/sdk/commit/46a8579c1eb58f6a36a7d094d9b7824c92873de4
2016-09-05 17:41:22 +02:00
Florian Loitsch 46a8579c1e Revert "Return futures on Stream.cancel when possible."
This reverts commit 1905ddafaa.

Review URL: https://codereview.chromium.org/2223133002 .
2016-08-08 19:31:04 +02:00
Florian Loitsch 1905ddafaa Return futures on Stream.cancel when possible.
Deprecate returning `null`.

Also, fixes cases where transformations on a stream didn't forward the cancel future

Fixes #26777.

BUG= http://dartbug.com/26777.
R=lrn@google.com

Committed: https://github.com/dart-lang/sdk/commit/395e7aaa696126b82862a9f75e7ebf742c354b56

Review URL: https://codereview.chromium.org/2202533003 .

Reverted: https://github.com/dart-lang/sdk/commit/99e5328eaca7f98641a5c6e523e80b7297792817
2016-08-08 17:30:36 +02:00
Florian Loitsch 99e5328eac Revert "Return futures on Stream.cancel when possible."
This reverts commit 395e7aaa69.

Review URL: https://codereview.chromium.org/2213193004 .
2016-08-05 14:32:14 +02:00
Florian Loitsch 395e7aaa69 Return futures on Stream.cancel when possible.
Deprecate returning `null`.

Also, fixes cases where transformations on a stream didn't forward the cancel future

Fixes #26777.

BUG= http://dartbug.com/26777.
R=lrn@google.com

Review URL: https://codereview.chromium.org/2202533003 .
2016-08-05 13:58:45 +02:00
Lasse R.H. Nielsen e9f48a37e8 Add getters for callbacks on StreamController.
R=floitsch@google.com, sgjesse@google.com

Review URL: https://codereview.chromium.org//1278873008 .
2015-08-11 10:55:48 +02:00
Lasse R.H. Nielsen 0a35f7be3b Update Changelog.
Fix various typos and style nits.

BUG=23961
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//1272593002 .
2015-08-05 12:58:30 +02:00
Lasse R.H. Nielsen 4a8a844c34 Add setters for callbacks on StreamController.
This allows you to create a stream controller at one point and
add or change the callbacks later. This can be useful if you
want to store a stream controller in a final instance field and
also want the controller to call instance methods as callbacks.

R=floitsch@google.com

Review URL: https://codereview.chromium.org//1242023007.
2015-07-17 12:03:00 +02:00
lrn@google.com 1f6d0e4f86 Make synchronous broadcast StreamController throw if adding event while adding event.
It already throws if there is more than one listener, but this change
also makes it throw if there is only one listener, for consistency.

Also add SynchronousStreamController abstract class.
It only contains documentation for synchronous stream controllers.

BUG= http://dartbug.com/22240
R=floitsch@google.com

Review URL: https://codereview.chromium.org//882713009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43946 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-23 10:36:58 +00:00
lrn@google.com 2b8981c436 Fix listeners being added to subscription after onListen was called.
BUG= http://dartbug.com/19722
R=floitsch@google.com, sgjesse@google.com

Review URL: https://codereview.chromium.org//357283003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37847 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-01 07:14:19 +00:00
lrn@google.com f3dd052a54 Fix typo in _DoneStreamSubscription.asFuture.
Add usage to test.

Review URL: https://codereview.chromium.org//304353016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36865 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-02 11:15:34 +00:00
lrn@google.com 5cbd1e05e2 Update documentation for "close" and fix subscription returned by closed broadcast streams.
The close method on StreamConsumer, StreamSink and StreamController do not explain
the returned future or say when it is completed.

Listening on a closed broadcast stream should not throw, but just give a subscription that sends a done asap.

BUG= http://dartbug.com/19095
R=ajohnsen@google.com

Review URL: https://codereview.chromium.org//301193010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36862 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-02 11:03:24 +00:00
lrn@google.com 35466f1e8b Fix typo in test.
Throwing the wrong exception - which was being overruled by a later
exception anyway.

Review URL: https://codereview.chromium.org//271273005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36022 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-12 10:18:37 +00:00
lrn@google.com f4fc2fc632 Make errors from StreamController onCancel calls end up in the returned future.
This changes errors happening in an onCancel callback from being uncaught
async errors (captured by zone.runGuarded) to being put into the result
future every time.
It already happens if the onCancel returns a future containing an error,
but if onCancel throws itself, it was different. This makes onCancel
act the same whether it fails immediately or asynchronously.

It should not change the behavior of current working programs:
an uncaught error would likely terminate the program, and the returned
futures are not checked for errors.
After the change, the error will reach the future and become uncaught there
instead, still terminating the program in the same way.

R=ajohnsen@google.com, floitsch@google.com

Review URL: https://codereview.chromium.org//269283007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36021 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-12 09:48:31 +00:00
floitsch@google.com 35e9ae50d9 Fix warnings in library-tests.
R=lrn@google.com

Review URL: https://codereview.chromium.org//54723007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29756 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-01 17:01:11 +00:00
floitsch@google.com dc9c5f42ed Redo StreamTransformers so they work with Stack traces.
Since this involved a breaking change I cleaned up more of the
StreamTransformer API.

This CL also deprecates the getAttachedStackTrace method.

R=ajohnsen@google.com, lrn@google.com, nweiz@google.com, rnystrom@google.com

Review URL: https://codereview.chromium.org//25354003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28562 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-12 12:34:34 +00:00
lrn@google.com 76d4625ccd Fixed bug in _ControllerStream.operator==.
Make _BroacastStream extends _ControllerStream to get same
equality behavior.

Add regression tests.

BUG= http://dartbug.com/11904
R=floitsch@google.com

Review URL: https://codereview.chromium.org//19775015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25205 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-19 11:58:08 +00:00
lrn@google.com d02d106430 Make StreamController be a StreamSink, not just an EventSink.
Reverts r24590

Review URL: https://codereview.chromium.org//18080019

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24791 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-08 08:27:27 +00:00
lrn@google.com 1315656027 Make asBroadcastStream take two callbacks.
These callbacks will be called when the broadcast stream no longer
has any listeners, or when it gets a listener after having none.

The callback is provided with a StreamSubscription-like object where
it can pause/resume/cancel the underlying subscription on the original
stream.

BUG=http://dartbug.com/11289
R=floitsch@google.com

Review URL: https://codereview.chromium.org//17490002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24776 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-04 13:02:02 +00:00
floitsch@google.com df2bcb893f Revert "Make StreamController be a StreamSink, not just an EventSink."
Revert "Remove type variable to work around dart2js bug."

This reverts commit r24587.
This reverts commit r24588.

Review URL: https://codereview.chromium.org//18080015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24590 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-28 15:07:09 +00:00
lrn@google.com a15e02cc6a Make StreamController be a StreamSink, not just an EventSink.
BUG=http://dartbug.com/10677
R=floitsch@google.com

Review URL: https://codereview.chromium.org//16240008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24587 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-28 12:56:29 +00:00
lrn@google.com faa7227cec Make new StreamController be async by default.
Change all instances, except some tests, to be sync still.
Rename Multiplex to Broadcast everywhere.

R=floitsch@google.com

Review URL: https://codereview.chromium.org//16125005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23453 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-31 06:07:39 +00:00
floitsch@google.com 80aad7930f Fix skipWhile.
BUG= http://dartbug.com/9480

Review URL: https://codereview.chromium.org//14242008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21623 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-17 15:39:42 +00:00
floitsch@google.com 62d413ec91 Remove StreamController.broadcast.
Review URL: https://codereview.chromium.org//14136004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21499 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-15 19:08:17 +00:00
floitsch@google.com 5431a5af54 Remove AsyncError with Expando.
Review URL: https://codereview.chromium.org//14251006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21498 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-15 18:58:32 +00:00
floitsch@google.com e2ee353940 Rename unsubscribeOnError to cancelOnError.
Review URL: https://codereview.chromium.org//14251013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21469 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-15 16:07:36 +00:00
ajohnsen@google.com 57161d6e59 Remove deprecated CollectionSink and Stream.pipeInto.
BUG=

Review URL: https://codereview.chromium.org//14051005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21261 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-11 09:31:50 +00:00
lrn@google.com 864b4472bc Fix stream_controller_test failure.
Review URL: https://codereview.chromium.org//13814010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21145 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-09 10:54:07 +00:00
floitsch@google.com 8fd6d0aafd Remove Expect from core library.
Committed: https://code.google.com/p/dart/source/detail?r=19755
Reverted: http://code.google.com/p/dart/source/detail?r=19756

Review URL: https://codereview.chromium.org//12212016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20996 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-05 19:43:16 +00:00
floitsch@google.com 5dc8107c53 Revert "Remove Expect from core library."
This reverts commit 19755.

Review URL: https://codereview.chromium.org//12743005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19756 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-09 03:19:07 +00:00
floitsch@google.com 12dbd2fd70 Remove Expect from core library.
Review URL: https://codereview.chromium.org//12212016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19755 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-09 02:40:37 +00:00
lrn@google.com bead146749 Renamed StreamSink to EventSink. Renamed signalError to addError.
Review URL: https://codereview.chromium.org//12610006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19683 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-08 11:31:19 +00:00
lrn@google.com cd4ae7e4af Add test for whether a completer or stream controller has been closed.
BUG=http://dartbug.com/8638

Review URL: https://codereview.chromium.org//12324004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19211 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-28 11:36:54 +00:00
lrn@google.com 9b23dff467 Reapply "Rename mappedBy to map."
This reverts commit r17907.

TBR.

Review URL: https://codereview.chromium.org//12090093

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17918 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-31 15:12:56 +00:00
floitsch@google.com b1a118d5ce Revert "Rename mappedBy to map."
This reverts commit 17899.

Review URL: https://codereview.chromium.org//12087103

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17907 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-31 14:02:27 +00:00
lrn@google.com 0dc2f4b1ba Rename mappedBy to map.
Retain a deprecated mappedBy for now.
Change return type of mappedBy, skip and take on List to Iterable.

BUG= http://dartbug.com/8063
BUG= http://dartbug.com/8064
BUG= http://dartbug.com/6739
BUG= http://dartbug.com/7982

Review URL: https://codereview.chromium.org//12086062

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17899 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-31 12:37:13 +00:00
lrn@google.com bdce730fb2 Remove transformEvents and make StreamEventTransformer extend StreamTransformer.
Make a StreamEventTransformer the default for the StreamTransformer
factory constructor, and remove the old implementation.

Review URL: https://codereview.chromium.org//12082047

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17761 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-29 14:04:26 +00:00
lrn@google.com 7fc981b3a6 Add public-facing method and class that allows intercepting stream events.
This allows intercepting events at the subscription level instead of creating
a new full stream and adding the events to that.

Also fix a number of typos and bugs detected by analyzer.

Review URL: https://codereview.chromium.org//11953103

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17746 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-29 08:43:15 +00:00
lrn@google.com 1f05296600 Change singleSubscription/multiSubscription to normal/broadcast.
Also make StreamController not a Stream.

Review URL: https://codereview.chromium.org//12049013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17563 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-24 13:30:27 +00:00
lrn@google.com ef13a0822b Make StreamController's unnamed constructor create a single-sub stream.
R=floitsch@google.com

Review URL: https://codereview.chromium.org//11887016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17049 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-15 09:09:47 +00:00
lrn@google.com 9e95844154 Make Streams also cosider a thrown AsyncError a rethrow.
Also change handleError to be based on throws for errors.

Review URL: https://codereview.chromium.org//11862008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16973 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-11 14:08:23 +00:00
lrn@google.com aa7cbb2b41 Remove Signal class and use Future/.whenComplete instead.
Review URL: https://codereview.chromium.org//11794043

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16792 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-08 12:59:00 +00:00
vsm@google.com 52f5c2ff22 Test fixes for dartium
Review URL: https://codereview.chromium.org//11778030

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16769 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-07 23:47:37 +00:00
floitsch@google.com 4a7dfd2da3 Big merge from experimental to bleeding edge.
Review URL: https://codereview.chromium.org//11783009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16687 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-07 11:23:16 +00:00