| Index: tests/corelib/list_test.dart
|
| diff --git a/tests/corelib/list_test.dart b/tests/corelib/list_test.dart
|
| index 8883e491aa5a401a888487feb0b15627052c6a85..deb26547a50d483c6711554e3f4eed6c788d1a4a 100644
|
| --- a/tests/corelib/list_test.dart
|
| +++ b/tests/corelib/list_test.dart
|
| @@ -44,6 +44,8 @@ void main() {
|
| testTypedGrowableList(new Int16List(0).toList());
|
| testTypedGrowableList(new Uint32List(0).toList());
|
| testTypedGrowableList(new Int32List(0).toList());
|
| +
|
| + testListConstructor();
|
| }
|
|
|
| void testLength(int length, List list) {
|
| @@ -492,3 +494,13 @@ class MyFixedList<E> extends ListBase<E> {
|
| E operator[](int index) => _source[index];
|
| void operator[]=(int index, E value) { _source[index] = value; }
|
| }
|
| +
|
| +void testListConstructor() {
|
| + Expect.throws(() { new List(0).add(4); }); // Is fixed-length.
|
| + Expect.throws(() { new List(-2); }); // Not negative.
|
| + Expect.throws(() { new List(null); }); // Not null.
|
| + Expect.listEquals([4], new List()..add(4));
|
| + Expect.throws(() { new List.filled(0, 42).add(4); }); // Is fixed-length.
|
| + Expect.throws(() { new List.filled(-2, 42); }); // Not negative.
|
| + Expect.throws(() { new List.filled(null, 42); }); // Not null.
|
| +}
|
|
|