dart-sdk/tests/corelib
Lasse R.H. Nielsen ed3824a220 Tweaks, refactoring and updates on DoubleLinkedQueue.
It's a badly designed class, but this change makes it slightly better.
(We should consider moving it to package:collection and removing it from
the platform libraries. Eventually.)

The changes decouples the public `DoubleLinkedQueueEntry` class from
the actual queue implementation classes, avoiding the latter having
to share a generic `_Link<DoubleLinkedQueueEntry>` interface
which would force them to do otherwise unnecessary casts.

The public class should have been abstract, but isn't.
It's mainly used as the API of the entries exposed by DoubleLinkedQueue,
but it can also be used by itself to build double-linked lists that are
not part of a Queue, and the class can be extended.
If anyone does either, it should keep working, so it needs to be a concrete,
self-contained class with a generative constructor.

That class is moved to dart:_internal to avoid its private
implementation fields from interfering with the queue implementation classes,
which have similar fields, but can now have them at different types.
That's a hack, but it works.

The internal implementation of the DoubleLinkedQueue and its entries
are updated to better follow current programming idioms, and avoids
having fields on classes which don't need them.

Also fixes #27920
(`clear`ing a list now detaches each entry from the list so later `.contains`
won't give the wrong answer).

And moves queue tests from tests/corelib to tests/lib/collection,
since Queue isn't exposed by `dart:core`.

BUG= https://github.com/dart-lang/sdk/issues/27920

Change-Id: Ia3bb340a75886de160cc0e449947e8e7ee587061
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211265
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-08-31 12:44:39 +00:00
..
regexp Treat the expect and async_helper packages as opted in to NNBD. 2020-04-27 21:04:56 +00:00
analysis_options.yaml [tests] Add analysis options file to migrated test directories 2020-03-16 20:51:26 +00:00
apply2_test.dart [vm/aot] Discard Code objects from the heap 2021-04-13 02:36:16 +00:00
apply3_test.dart
apply4_test.dart
apply5_test.dart
apply6_test.dart [js_runtime] Don't modify inputs to Function.apply 2021-06-24 03:29:38 +00:00
apply_generic_function_test.dart [test] Fix various static errors in corelib tests 2020-04-16 09:20:21 +00:00
apply_test.dart [test] Fix various static errors in corelib tests 2020-04-16 09:20:21 +00:00
bigint_from_test.dart [vm/aot] Discard Code objects from the heap 2021-04-13 02:36:16 +00:00
bigint_js_test.dart
bigint_parse_radix_test.dart
bigint_test.dart [corelib] Fix for BigInt.toDouble() crash 2020-05-09 00:22:16 +00:00
bit_twiddling_test.dart
bool_from_environment2_test.dart
bool_from_environment_test.dart
bool_hashcode_test.dart
bool_operator_test.dart
cast_errors_test.dart Move codes from StaticTypeWarningCode into CompileTimeErrorCode. 2020-07-27 16:44:15 +00:00
cast_helper.dart [tests] Fix cast_test and migrate to nnbd. 2020-04-30 02:33:53 +00:00
cast_iterable_test.dart [tests] Fix cast_test and migrate to nnbd. 2020-04-30 02:33:53 +00:00
cast_list_test.dart [tests] Fix cast_test and migrate to nnbd. 2020-04-30 02:33:53 +00:00
cast_map_test.dart [tests] Fix cast_test and migrate to nnbd. 2020-04-30 02:33:53 +00:00
cast_set_test.dart [tests] Fix cast_test and migrate to nnbd. 2020-04-30 02:33:53 +00:00
cast_strong_test.dart Change types to <C?, D> in cast test for nnbd 2020-05-01 17:02:23 +00:00
cast_weak_test.dart Change types to <C?, D> in cast test for nnbd 2020-05-01 17:02:23 +00:00
collection_from_test.dart
collection_length_test.dart [test] Remove use of List constructor in corelib tests 2020-04-17 08:45:46 +00:00
collection_of_test.dart
collection_removes_test.dart
collection_test.dart
collection_to_string_test.dart
compare_to2_test.dart
compare_to_test.dart
const_list_literal_test.dart
const_list_remove_range_test.dart
const_list_set_range_test.dart
core_runtime_types_static_test.dart
core_runtime_types_test.dart Make all CastErrors be TypeErrors. 2020-03-11 23:31:06 +00:00
corelib.status [vm/gardening] Mark bigint_parse_radix_test/3 as slow 2021-08-31 09:56:50 +00:00
data_uri_test.dart
date_time2_test.dart
date_time3_test.dart
date_time4_test.dart
date_time5_test.dart
date_time6_test.dart
date_time7_test.dart
date_time8_test.dart
date_time9_test.dart
date_time10_test.dart
date_time11_test.dart [tests] Cleaning up migrated corelib tests. 2020-03-24 17:34:25 +00:00
date_time_extremes_test.dart
date_time_far_away_dates_test.dart
date_time_js_modified_test.dart [ddc] Copy JS 2-digit year handling from dart2js. 2020-09-26 01:11:54 +00:00
date_time_parse_test.dart
date_time_test.dart
double_ceil2_test.dart
double_ceil_test.dart
double_ceil_to_double_test.dart
double_compare_test.dart
double_floor2_test.dart
double_floor_test.dart
double_floor_to_double_test.dart
double_hash_code_test.dart
double_parse_test.dart
double_round2_test.dart
double_round3_test.dart
double_round4_test.dart
double_round_test.dart
double_round_to_double2_test.dart
double_round_to_double3_test.dart
double_round_to_double_test.dart
double_truncate2_test.dart
double_truncate_test.dart
double_truncate_to_double_test.dart
double_try_parse_test.dart
duration_big_num_test.dart
duration_double_multiplication_test.dart
duration_test.dart Revert "Fix duration.toString() to conform the description" 2020-06-22 10:29:15 +00:00
dynamic_nosuchmethod_test.dart [vm] Reland "Remove non-covariant checks from closure bodies (part 1)" 2020-07-21 10:00:41 +00:00
error_stack_trace1_test.dart Make tests not assume catch(e) gives e type dynamic. 2020-05-05 09:57:23 +00:00
error_stack_trace2_test.dart [tests] adjust error_stack_trace2_test to work also for DDC. 2020-04-02 18:25:29 +00:00
error_stack_trace_test.dart Make tests not assume catch(e) gives e type dynamic. 2020-05-05 09:57:23 +00:00
errors_test.dart Try to clarify the RangeError.range message 2020-05-27 14:59:39 +00:00
exception_implementation_test.dart
expando_test.dart Rereland "[vm/ffi] Disallow Pointers and structs in finalizers and expandos" 2021-04-14 12:07:18 +00:00
expression_test.dart
for_in_test.dart
format_exception_test.dart
from_environment_const_type_test.dart
from_environment_const_type_undefined_test.dart Change tests to expect new behavior of fromEnvironment 2020-03-17 13:43:17 +00:00
from_environment_default_value_test.dart Added new tests. 2020-03-27 19:02:52 +00:00
growable_list_test.dart [tests] Remove more deprecated List constructor usage in tests 2020-04-07 20:09:26 +00:00
has_next_iterator_test.dart
hash_map2_test.dart
hash_map_test.dart
hash_set_test.dart
hash_set_type_check_test.dart
hashcode_boxed_test.dart
hashcode_test.dart
hidden_library2_test.dart
int_ceil_test.dart
int_ceil_to_double_test.dart
int_floor_test.dart
int_floor_to_double_test.dart
int_from_environment2_test.dart Change tests to expect new behavior of fromEnvironment 2020-03-17 13:43:17 +00:00
int_from_environment_int64_test.dart
int_from_environment_test.dart
int_modpow_hard_test.dart
int_modulo_arith_test.dart
int_parse_radix_bad_handler_test.dart
int_parse_radix_int64_test.dart
int_parse_radix_test.dart
int_parse_with_limited_ints_test.dart
int_round_test.dart
int_round_to_double_test.dart
int_to_int_test.dart
int_truncate_test.dart
int_truncate_to_double_test.dart
int_try_parse_int64_test.dart
int_try_parse_test.dart
integer_arith_vm_test.dart
integer_parsed_arith_vm_test.dart
integer_parsed_div_rem_vm_test.dart
integer_parsed_mul_div_vm_test.dart
integer_to_radix_string_test.dart
integer_to_string_test.dart
invocation_test.dart
is_operator_basic_types_test.dart
iterable_contains2_test.dart
iterable_contains_test.dart [tests] Removing more List constructor usage in corelib tests. 2020-04-06 19:17:54 +00:00
iterable_element_at_test.dart
iterable_empty_test.dart
iterable_expand_test.dart
iterable_first_test.dart
iterable_first_where_test.dart
iterable_fold_test.dart [tests] Removing more List constructor usage in corelib tests. 2020-04-06 19:17:54 +00:00
iterable_followed_by_test.dart [tests] Cleaning up migrated corelib tests. 2020-03-24 17:34:25 +00:00
iterable_generate_test.dart
iterable_join_test.dart
iterable_last_test.dart
iterable_last_where_test.dart
iterable_length_test.dart
iterable_mapping_test.dart
iterable_reduce_test.dart [tests] Removing more List constructor usage in corelib tests. 2020-04-06 19:17:54 +00:00
iterable_return_type_helper.dart [tests] Clean up List constructor usage and unused multi-test 2020-04-01 00:03:46 +00:00
iterable_return_type_int64_test.dart [tests] Clean up List constructor usage and unused multi-test 2020-04-01 00:03:46 +00:00
iterable_return_type_test.dart [tests] Clean up List constructor usage and unused multi-test 2020-04-01 00:03:46 +00:00
iterable_single_test.dart
iterable_single_where_test.dart
iterable_skip_test.dart Cleaning up corelib test migrations. 2020-02-03 19:06:17 +00:00
iterable_skip_while_test.dart Cleaning up corelib test migrations. 2020-02-03 19:06:17 +00:00
iterable_take_test.dart Make ListMixin.take check that the argument is not null. 2021-01-28 17:19:35 +00:00
iterable_take_while_test.dart Cleaning up corelib test migrations. 2020-02-03 19:06:17 +00:00
iterable_test.dart
iterable_to_list_test.dart [tests] Cleaning up migrated corelib tests. 2020-03-24 17:34:25 +00:00
iterable_to_set_test.dart
iterable_tostring_test.dart
iterable_where_type_test.dart
json_map_test.dart
linked_hash_map_from_iterable_test.dart
linked_hash_map_from_iterables_test.dart
linked_hash_map_test.dart [tests] Removing List constructor usage in corelib tests. 2020-03-30 19:58:08 +00:00
list_as_map_test.dart [tests] Removing List constructor usage in corelib tests. 2020-03-30 19:58:08 +00:00
list_concurrent_modify_self_test.dart [tests] Split corelib{,_2}/list_concurrent_modify_test 2020-11-05 19:46:35 +00:00
list_concurrent_modify_test.dart [tests] Split corelib{,_2}/list_concurrent_modify_test 2020-11-05 19:46:35 +00:00
list_contains_argument_order_test.dart [tests] Removing List constructor usage in corelib tests. 2020-03-30 19:58:08 +00:00
list_copy_range_test.dart
list_fill_range_test.dart
list_filled_type_argument_test.dart
list_first_test.dart
list_fixed_test.dart [tests] Removing List constructor usage in corelib tests. 2020-03-30 19:58:08 +00:00
list_for_each_test.dart [tests] Removing List constructor usage in corelib tests. 2020-03-30 19:58:08 +00:00
list_get_range_test.dart
list_growable_test.dart [tests] Removing List constructor usage in corelib tests. 2020-03-30 19:58:08 +00:00
list_index_of_test.dart [tests] Removing List constructor usage in corelib tests. 2020-03-30 19:58:08 +00:00
list_insert_all_test.dart [nnbd/test] Fix some strong mode tests. 2020-03-31 18:14:45 +00:00
list_insert_test.dart [tests] Removing List constructor usage in corelib tests. 2020-03-30 19:58:08 +00:00
list_iterators_test.dart [tests] Removing List constructor usage in corelib tests. 2020-03-30 19:58:08 +00:00
list_last_test.dart
list_literal_is_growable_test.dart
list_literal_test.dart
list_map_test.dart [cfe] Update greatest closure of ? to Object? 2020-05-04 08:14:43 +00:00
list_remove_range_test.dart
list_removeat_test.dart [vm] Rename --null-safety option to --sound-null-safety 2020-07-09 01:37:23 +00:00
list_replace_range_test.dart [nnbd/test] Fix some strong mode tests. 2020-03-31 18:14:45 +00:00
list_reversed_test.dart [cfe] Update greatest closure of ? to Object? 2020-05-04 08:14:43 +00:00
list_set_all_test.dart
list_set_range_test.dart [tests] Removing List constructor usage in corelib tests. 2020-03-30 19:58:08 +00:00
list_sort_test.dart
list_sublist_test.dart
list_test.dart Fix list tests to not set length on non-nullable lists. 2020-07-15 00:45:43 +00:00
list_to_string2_test.dart [tests] Removing List constructor usage in corelib tests. 2020-03-30 19:58:08 +00:00
list_to_string_test.dart
list_unmodifiable_cast_test.dart
list_unmodifiable_test.dart
list_write_elements_test.dart
local_date_time_test.dart Change VM DateTime to-local-time computation to not fail for <1h changes. 2021-04-08 16:51:00 +00:00
main_test.dart
map_contains_key_test.dart
map_contains_value_test.dart
map_entry_test.dart Convert from _JsonMap to Map<String, Object> in corelib/map_entry_test 2020-03-20 17:58:22 +00:00
map_from_entries_test.dart
map_from_iterable_test.dart
map_from_iterables_test.dart
map_from_test.dart
map_index_test.dart
map_keys2_test.dart
map_keys_test.dart
map_of_test.dart Make all CastErrors be TypeErrors. 2020-03-11 23:31:06 +00:00
map_remove_test.dart
map_set_undefined_test.dart [cfe] Report error on missing return from non-nullable function 2020-03-24 08:21:36 +00:00
map_test.dart [test] Fix various static errors in corelib tests 2020-04-16 09:20:21 +00:00
map_to_string_test.dart
map_unmodifiable_cast_test.dart [tests] Cleaning up migrated corelib tests. 2020-03-24 17:34:25 +00:00
map_update_test.dart
map_values2_test.dart
map_values3_test.dart
map_values4_test.dart
map_values_test.dart
nan_infinity_test.dart
nsm_invocation_generic_test.dart
nsm_invocation_test.dart
null_nosuchmethod_test.dart [vm] Reland "Remove non-covariant checks from closure bodies (part 1)" 2020-07-21 10:00:41 +00:00
null_test.dart
num_clamp_test.dart
num_parse_test.dart
num_sign_test.dart
num_try_parse_test.dart
object_hash_test.dart Add Object.hash and Object.hashAll static helper methods. 2021-06-25 11:40:35 +00:00
range_error_test.dart [tests] Removing List constructor usage in corelib tests. 2020-03-30 19:58:08 +00:00
reg_exp1_test.dart
reg_exp5_test.dart
reg_exp_all_matches_test.dart Rename is{Strong,Weak}Mode to has{Sound,Unsound}NullSafety 2020-11-05 14:26:53 +00:00
reg_exp_cache_test.dart
reg_exp_first_match_test.dart
reg_exp_group_test.dart
reg_exp_groups_test.dart
reg_exp_has_match_test.dart
reg_exp_pattern_test.dart
reg_exp_receive_port_test.dart [vm/regexp] Ensure regex sent in a message can be used by the receiver. 2021-06-09 02:50:50 +00:00
reg_exp_start_end_test.dart
reg_exp_string_match_test.dart
regress_11099_test.dart
regress_33166_test.dart
regress_42011_test.dart [vm/corelib] Fix ConcurrentModificationError for empty addAll. 2020-11-25 12:01:44 +00:00
regress_42502_test.dart [vm/corelib/nnbd] Fix null check in _GrowableList.length= 2020-06-30 17:14:14 +00:00
regress_45473_test.dart Fix null-safety migration error in CastMap. 2021-05-10 14:15:07 +00:00
regress_r21715_test.dart
safe_to_string_test.dart
set_contains_test.dart
set_containsAll_test.dart
set_intersection_test.dart
set_iterator_test.dart [cfe] Report error on missing return from non-nullable function 2020-03-24 08:21:36 +00:00
set_remove_test.dart
set_removeAll_test.dart
set_retainAll_test.dart
set_test.dart [corelib] Add Set.unmodifiable backed by an UnmodifiableSetView 2020-12-10 11:00:27 +00:00
set_to_string_test.dart
set_unmodifiable_view_test.dart [corelib] Add Set.unmodifiable backed by an UnmodifiableSetView 2020-12-10 11:00:27 +00:00
shuffle_test.dart
sort_helper.dart [tests] Removing more List constructor usage in corelib tests. 2020-04-06 19:17:54 +00:00
sort_test.dart
splay_tree_from_iterable_test.dart
splay_tree_from_iterables_test.dart
splay_tree_test.dart Add efficient entries and keys.contains to SplayTreeMap. 2021-03-22 13:20:13 +00:00
stacktrace_current_test.dart
stacktrace_fromstring_test.dart [cfe] Handle throw in return type inference 2020-03-27 15:59:27 +00:00
stopwatch2_test.dart
stopwatch_test.dart
string_base_vm_static_test.dart
string_base_vm_test.dart [tests] Removing List constructor usage in corelib tests. 2020-03-30 19:58:08 +00:00
string_buffer_test.dart
string_case_test.dart
string_codeunits_test.dart
string_from_environment2_test.dart
string_from_environment3_test.dart
string_from_environment_test.dart Reland "[ CLI ] Improved consistency of -D and --define across tools and commands" 2021-02-05 23:53:28 +00:00
string_from_list_test.dart [tests] Removing List constructor usage in corelib tests. 2020-03-30 19:58:08 +00:00
string_fromcharcode_test.dart
string_fromcharcodes_test.dart
string_operations_with_null_test.dart [vm/nnbd] Fix CompileType::IsAssignableTo for nullable types in strong mode 2020-03-25 17:32:02 +00:00
string_pattern_test.dart
string_replace_all_2_test.dart
string_replace_all_test.dart
string_replace_dollar_test.dart
string_replace_static_test.dart
string_replace_test.dart
string_runes_test.dart Updating iterator expected values from null to -1. 2020-01-18 02:55:28 +00:00
string_source_test.dart
string_split_test.dart
string_static_test.dart
string_substring_test.dart
string_test.dart
string_to_lower_case_test.dart
string_trim2_test.dart
string_trim_test.dart
string_trimlr_test.dart
strings_test.dart
symbol_arbitrary_string_test.dart Correct symbol_reserved_word_test.dart, splitting it into two tests. 2021-06-01 15:55:03 +00:00
symbol_map_helper.dart [test] Fix various static errors in corelib tests 2020-04-16 09:20:21 +00:00
symbol_operator_test.dart Adjust symbol tests to new semantics 2021-07-01 18:43:14 +00:00
symbol_reserved_word_error_test.dart Correct symbol_reserved_word_test.dart, splitting it into two tests. 2021-06-01 15:55:03 +00:00
symbol_reserved_word_test.dart Correct symbol_reserved_word_test.dart, splitting it into two tests. 2021-06-01 15:55:03 +00:00
symbol_test.dart Adjust symbol tests to new semantics 2021-07-01 18:43:14 +00:00
throw_half_surrogate_pair_test.dart
toInt_test.dart
type_hashcode_test.dart
type_tostring_test.dart Fix corelib/type_tostring_test.dart 2021-04-16 07:33:57 +00:00
typed_data_with_limited_ints_test.dart
unicode2_test.dart
unicode_test.dart
unsigned_shift_test.dart Remove references to triple-shift and generic-metadata experiments. 2021-05-12 13:35:00 +00:00
uri_base_test.dart
uri_file_test.dart
uri_http_test.dart Uri.https and Uri.http constructors queryParams type 2021-01-11 15:22:06 +00:00
uri_ipv4_test.dart
uri_ipv6_test.dart
uri_normalize_path_test.dart
uri_normalize_test.dart
uri_parameters_all_test.dart
uri_parse_test.dart
uri_path_test.dart
uri_query_test.dart
uri_scheme_test.dart
uri_test.dart Change resolve for package:URIs to not remove package name. 2021-02-05 18:31:48 +00:00
very_big_integer_test.dart [vm, compiler] Fix size of sign-extension in x64c BigInt intrinsics. 2021-06-03 22:47:56 +00:00