Commit Graph

58 Commits

Author SHA1 Message Date
Johnni Winther 645f3acca7 [cfe] Update greatest closure of ? to Object?
Closes #41386

Change-Id: I1a5a4cdc35cef37c7a8ba6a6aecb99457789bcdc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144940
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-05-04 08:14:43 +00:00
Liam Appelbe 2e75c3d7ca [nnbd] Fix remaining async tests in strong mode.
stream_controller_async_test and stream_join_test are built on
async_minitest, so most of the issues were fixed by migrating it to use
Never as the bottom type rather than Null.

Change-Id: I6f43e818a7a8d6793844166c8f9fc07b3b0f7a16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143562
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2020-04-16 21:15:45 +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
Zachary Anderson 63c4b6b1cb Revert "Remove package:unittest from some tests"
This reverts commit dde47b2aad.

Revert "Update Dartium status for passing test"

This reverts commit d71c70d56d.

Tests failing on dart2js and async_star_pause_test is
passing on Dartium. Need to think about how to update the
status files.

Review-Url: https://codereview.chromium.org/2656503004 .
2017-01-25 11:06:58 -08:00
Zachary Anderson dde47b2aad Remove package:unittest from some tests
package:unittest is deprecated in favor of package:test.

R=fschneider@google.com

Review-Url: https://codereview.chromium.org/2656743002 .
2017-01-25 08:50:02 -08:00
floitsch@google.com f4a1b28077 Move isolate tests to lib/isolate.
Moves most tests that require dart:isolate to the isolate-directory in the tests section.

Also enables the string_from_environment_default_value_test which didn't have "_test" in its name.

R=lrn@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45701 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-11 17:59:51 +00:00
lrn@google.com 181efd76ee Add missing null-tests to async error functions.
Also treat null errors comming out of Zone.errorCallback as
NullThrownError.

This should prevent, as was always the intention, any async error
from having a null value.
This is important for async/await syntax, where the distinction
between sync and async errors is removed.

(For Dart 2.0, we could just make null throwable).

R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40673 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-25 11:00:49 +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
kevmoo@google.com 0726458e52 tests: import unittest via package: url
R=ricow@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34602 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-01 16:12:39 +00:00
kevmoo@google.com 5952d7a067 Upgrading tests with unittest deprecations
R=ricow@google.com, sigmund@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34569 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-31 18:33:18 +00:00
lrn@google.com c0bbe6e388 Expose the cancelOnError in the StreamController.addStream.
Type tests, so this would have been caught.

R=ajohnsen@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29434 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-29 11:28:29 +00:00
lrn@google.com 5b0ac43e80 Fix bugs in StreamController.addStream.
Add optional 'cancelOnError' to addStream method. It still defaults
to true.
Resume the added stream when adding a listener (14332).
Handle cancel-on-error correctly, so the future completes as well (14334).

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29419 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-29 08:59:52 +00:00
ajohnsen@google.com eb64b2486f Let StreamSubscription.cancel return a Future.
This gives the ability mark a subscription cancel as asynchrouns. Thiw
now means that StreamController's onCancel takes either a value (null in
    most cases) and a Future, just like 'new Future(() => value)'.

BUG=
R=floitsch@google.com, lrn@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28925 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-21 12:09:41 +00:00
lrn@google.com a2e03e5463 Fix flaky stream_controller_async_test.
BUG= http://dartbug.com/163608
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28719 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-16 11:29:13 +00:00
floitsch@google.com 146150ac51 Wait for the pause-event to have finished.
BUG= http://dartbug.com/13608
R=lrn@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27943 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-26 12:12:42 +00:00
floitsch@google.com 89373813f9 Make async stream test less flaky.
R=kustermann@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26923 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-30 15:53:23 +00:00
floitsch@google.com a9cefff022 elementAt throws a RangeError not StateError.
Review URL: https://codereview.chromium.org//23429002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26651 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-26 14:56:26 +00:00
lrn@google.com 0f8d8f3028 Don't assume that I can use package:-url in test.
Review URL: https://codereview.chromium.org//18271016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24839 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-09 11:25:22 +00:00
lrn@google.com 91aa700848 Add Stream.join
BUG= http://dartbug.com/11652
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24838 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-09 10:55:13 +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
lrn@google.com 79a0a652d0 Implement asBroadcast using a _MultiplexStreamController.
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23342 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-29 10:39:35 +00:00
lrn@google.com 37b1cd3b3f Optimize internals of multiplex-streams.
Make the multiplex streams broadcast streams.
This allows you to listen twice on the same stream, instead of having to get
a new stream each time.

R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23256 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-28 12:06:34 +00:00
lrn@google.com 781e84284f Reapply "Active stream subscriptions".
Makes subscriptions the active part of a stream, with the stream
itself being just an inert creator of subscriptions.

This changes the behavior of a "single subscription" stream to match
the documentation: After the subscription is canceled, you can't
resubscribe to the stream. Previously, you could do that, but it was
never documented or intended.
This also makes the stream of a StreamController not be paused while
before it's subscribed - it is always the subscription that is paused
or not, and while there is no subscription, the stream cannot be
paused. Previously the stream was set to paused until the first
subscription in order to prevent events from being lost. That is
handled independently of pauses now.

Adds StreamController.multiplex constructor. This name is tentative,
and likely to change. Its behavior may change as well. It currently
provides a new single-subscription stream each time its "stream"
getter is read, and you can subscribe to these.

Adds StreamIterator class that allows iterating over a stream's data
events using (async) "moveNext()" and "current", like a direct style
Iterator (sorry, it won't work in a for-in loop).

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23237 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-28 07:28:36 +00:00
lrn@google.com cc0d9d57af Revert until Windows crash is debugged.
Reverts r23218, r23217, r23208, r23207, r23206, r23205, r23204.

r23218 | Path observer is listened more than once, so make it multiplex.
r23217 | Add StreamController.multiplex constructor.
r23208 | Fix bug in streamimpl
r23207 | Fix bug in stream iterator.
r23206 | Change expectations for http_parser_test.
r23205 | Fix bug in stream-impl.
r23204 | Make StreamSubscription be the active part of a string.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23221 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-27 13:03:03 +00:00
lrn@google.com 23162a3847 Add StreamController.multiplex constructor.
The "multiplex" stream controller will generate a new stream every
time .stream is read on the controller, and it will send events to
any stream that currently has a listener.
The streams handle their own buffering. Events added before the listen
are ignored.

R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23217 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-27 12:27:20 +00:00
lrn@google.com ee1c11a2a6 Make StreamSubscription be the active part of a string.
It is the one keeping the buffer of events, not the stream.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23204 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-27 08:34:20 +00:00
ajohnsen@google.com f2f0261bf5 Add Stream.drain() method.
This method will discard all data on the stream and return a Future to
mark the end of the stream.

BUG=
R=floitsch@google.com, sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23140 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-24 12:45:42 +00:00
lrn@google.com 084cc64ce1 Add Stream.forEach
Review URL: https://codereview.chromium.org//14312010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21608 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-17 09:13:16 +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
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 f41508d33b Added new version of reduce.
Removed min/max and uses of min/max.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21258 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-11 08:32:31 +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 bef8ebb5f6 Add Iterable.fold (and Stream.fold) which replace reduce.
For now this is just a copy. In a next step we will change the behavior of
`reduce`.

BUG= http://dartbug.com/9536

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20978 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-05 16:12:40 +00:00
floitsch@google.com 65718c56df Rename XMatching to XWhere.
For example firstMatching -> firstWhere.

BUG= http://dartbug.com/8664
BUG= http://dartbug.com/8337

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19880 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-12 17:34:49 +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 03f5a66836 Recommit changing List.skip/take/revert returns Iterable and remove mappedBy.
This reverts r18591.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18615 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-18 10:35:51 +00:00
rnystrom@google.com 0e0473d33a Unbreak pub:
Revert "Make List.skip, List.take and List.reversed return Iterables, not Lists."

This reverts commit 44c3745a76acfad3d1d5bfc7a8b8c8e2def30e09.

Revert "Remove deprecated mappedBy."

This reverts commit 779ab69eab73e5e349245e99560b18955908e0cc.

BUG=dartbug.com/8560

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18591 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-15 18:38:42 +00:00
floitsch@google.com 0672317bec Remove deprecated mappedBy.
Committed: https://code.google.com/p/dart/source/detail?r=18575
Reverted: http://code.google.com/p/dart/source/detail?r=18576

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18579 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-15 13:57:18 +00:00
floitsch@google.com ad839e6957 Revert "Remove deprecated mappedBy."
This reverts commit 18575.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18576 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-15 13:23:22 +00:00
floitsch@google.com b37100770b Remove deprecated mappedBy.
Review URL: https://codereview.chromium.org//12212213

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18575 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-15 13:18:17 +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