dart-sdk/tests/corelib_2/iterable_return_type_test.dart
Riley Porter b9d35ded2e [tests] Clean up List constructor usage and unused multi-test
Split out int64 lines of multi-test for
corelib/iterable_return_type_test and added status to skip the
int64 test on the web compilers.

Change-Id: I1e56299973956932c5b16b1ceeeb2b8f00457bf5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141802
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
2020-04-01 00:03:46 +00:00

51 lines
1.6 KiB
Dart

// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// 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.
// Regression test for dart2js where [List.addAll] was not typed
// correctly.
import 'iterable_return_type_helper.dart';
import 'dart:collection';
import 'dart:typed_data';
main() {
// Empty lists.
testList(<int>[]);
testList(new List<int>(0));
testList(new List<int>());
testList(const <int>[]);
testList(new List<int>.generate(0, (x) => x + 1));
// Singleton lists.
testList(<int>[1]);
testList(new List<int>(1)..[0] = 1);
testList(new List<int>()..add(1));
testList(const <int>[1]);
testList(new List<int>.generate(1, (x) => x + 1));
// Typed lists.
testList(new Uint8List(1)..[0] = 1);
testList(new Int8List(1)..[0] = 1);
testList(new Uint16List(1)..[0] = 1);
testList(new Int16List(1)..[0] = 1);
testList(new Uint32List(1)..[0] = 1);
testList(new Int32List(1)..[0] = 1);
testIterable(new Set<int>()..add(1));
testIterable(new HashSet<int>()..add(1));
testIterable(new LinkedHashSet<int>()..add(1));
testIterable(new SplayTreeSet<int>()..add(1));
testIterable(new Queue<int>()..add(1));
testIterable(new DoubleLinkedQueue<int>()..add(1));
testIterable(new ListQueue<int>()..add(1));
testMap(new Map<int, int>()..[1] = 1);
testMap(new HashMap<int, int>()..[1] = 1);
testMap(new LinkedHashMap<int, int>()..[1] = 1);
testMap(new SplayTreeMap<int, int>()..[1] = 1);
testMap(<int, int>{1: 1});
testMap(const <int, int>{1: 1});
}