Commit Graph

37 Commits

Author SHA1 Message Date
Oleksii Khomchenko 64226729c1 [corelib] Add Set.unmodifiable backed by an UnmodifiableSetView
UnmodifiableSetView does not have backend specific implementations
(simillar to UnmodifiableMapView, unlike UnmodifiableListView).

Closes https://github.com/dart-lang/sdk/issues/36901

Change-Id: I041bb6dc95d6a67a395ca75581ffe8e5933acdc6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164103
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-12-10 11:00:27 +00:00
Riley Porter ed086f0f95 [tests] Remove more deprecated List constructor usage in tests
Change-Id: I9a6da832ee51f9362bb2ea4f17931a109b36456e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142721
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
2020-04-07 20:09:26 +00:00
Mark Zhou 2228b6d337 [tests] Cleaning up migrated corelib tests.
Change-Id: I7ac31a6bf66c777202a6c642bae584af8e3288ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140380
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2020-03-24 17:34:25 +00:00
Robert Nystrom b998b10f3e Migrate remaining corelib_2/ tests to NNBD.
Change-Id: I3a31632ce28fb87a410b759d092c7ebc9393574d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128306
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2019-12-17 23:06:24 +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
Bob Nystrom edee53f93d Bring back the deleted 1.0 corelib tests.
What is dead may never die.

Change-Id: I80ef766b8ce2b6e1416df8e1f9b91fb74169dc79
Reviewed-on: https://dart-review.googlesource.com/7483
Reviewed-by: William Hesse <whesse@google.com>
2017-09-21 18:29:40 +00:00
Janice Collins 51cc9689b3 Remove corelib and corelib_strong and migrate last two remaining tests.
This includes a migration of linked_hash_map_from_iterable_test and
stacktrace_current_test, which were migrated without changes.

BUG=
R=rnystrom@google.com, whesse@google.com

Review-Url: https://codereview.chromium.org/3004073002 .
2017-09-01 08:11:15 -07:00
Erik Corry 029b1cb948 Spelling fixes e to i.
R=kevmoo@google.com
BUG=

Review-Url: https://codereview.chromium.org/2957593002 .
2017-06-24 13:41:39 +02: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 6beb1fdd11 Change Set.difference API to accept Set<Object>.
Fixes #27573
BUG= http://dartbug.com/27573
R=lrn@google.com

Review URL: https://codereview.chromium.org/2413233002 .
2016-10-20 14:37:15 +02:00
Florian Loitsch e19addf23e Make dart:collection strong-mode clean.
R=leafp@google.com

Review URL: https://codereview.chromium.org/1937103002 .
2016-05-11 16:28:43 +02:00
Florian Loitsch b19e00c2d4 Fix Set.from which still had a generic type on the incoming Iterable.
Follow-up fix for http://dartbug.com/21731
Also see https://codereview.chromium.org/838463002/

R=lrn@google.com

Review URL: https://codereview.chromium.org/1887883006 .
2016-04-28 15:01:04 +02:00
lrn@google.com cfa14bc32f Fix typo in set_test.dart, makes analyzer complain.
Review URL: https://codereview.chromium.org//837703002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42633 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-06 14:53:22 +00:00
lrn@google.com 3f1780f70d Change List/Set/Map/Queue.from constructrs to accept any iterable.
This allows using the .from constructor as a cast:

  new Set<int>.from(numSetContainingOnlyInts);

BUG= http://dartbug.com/21731
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42620 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-06 10:14:56 +00:00
lrn@google.com 61fb66c9e4 The toSet operation returns a new Set with the same equality and iteration behavior, and with the same elements.
R=floitsch@google.com, jmesserly@google.com, sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36473 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-22 08:29:59 +00:00
lrn@google.com 410268a15e Fix set test, number of arguments to helper function changed.
Review URL: https://codereview.chromium.org//77993003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30457 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-20 10:42:28 +00:00
lrn@google.com cd2cf5058e Add SplayTreeSet.
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30444 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-20 09:35:39 +00:00
kevmoo@j832.com cf134382a1 Set.add returns true if item has been added, otherwise false
BUG= https://code.google.com/p/dart/issues/detail?id=3546
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28863 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-18 17:24:24 +00:00
lrn@google.com 6d49d9f1ac Reapply "Convert HashSet, LinkedHashSet to factory methods and custom implementations."
R=floitsch@google.com, fschneider@google.com, kasperl@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27610 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-18 11:36:25 +00:00
lrn@google.com 18362b2cf4 Revert "Convert HashSet, LinkedHashSet to factory methods and custom implementations."
Triggers an error in html tests on dartium.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27392 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-11 16:19:45 +00:00
lrn@google.com c5bb6f7b15 Convert HashSet, LinkedHashSet to factory methods and custom implementations.
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27378 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-11 12:35:57 +00:00
floitsch@google.com 5d058bb0eb Adding isNotEmpty property to collection and string.
BUG= http://dartbug.com/3074
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23294 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-28 17:30:37 +00:00
ajohnsen@google.com 044f0d02eb Remove Collection, Collections and clean up List/Set/Queue implementations of retain/remove.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21338 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-12 09:34:52 +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 a84cdc03ae Revert "Ints don't have "isEven" anymore."
This reverts commit 19935.
Dart2js has been fixed.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20012 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-14 12:27:54 +00:00
floitsch@google.com cc7dfdcd14 Ints don't have "isEven" anymore.
Review URL: https://codereview.chromium.org//12836002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19935 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-13 15:02:44 +00:00
lrn@google.com f9ae90a844 Add Set.union, Set.difference. Change Set methods to expect Set.
Previously the Set methods expected a Collection, which made no
sense.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19926 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-13 13:05:48 +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 719aca47b1 Restructure SplayTreeMap to be reusable (e.g., for a SplayTreeSet).
Add documentation that all keys of the map must be comparable to each other.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19209 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-28 10:02:40 +00:00
lrn@google.com 6b4f4b1bab Change new List(n) to return fixed length list.
Deprecate List.fixedLength, add List.filled.

Make Iterable.toList and List.from take "growable" argument,
defaulting to false.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19112 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-27 08:45:04 +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
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
floitsch@google.com 27cadf2b66 isEven, isOdd, isNegative, isMaxValue, isMinValue, isInfinite, isPositive, isSingleValue.
Review URL: https://codereview.chromium.org//11227042

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13974 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-23 16:15:36 +00:00
sigmund@google.com d9eae90196 test rename overhaul: step 7 - corelib tests
Review URL: https://chromiumcodereview.appspot.com//10244009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7096 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-27 18:06:37 +00:00