blob: 824c62fc2a18d1cd44a5b2bd1900ef707bbb743b [file] [log] [blame]
// Copyright (c) 2011, 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.
// @dart = 2.9
/// @assertion abstract Iterable<E> getRange(int start, int end)
/// An error occurs if end is before start.
/// @description Checks that an error is thrown if end is before start.
/// @author vasya
/// @reviewer varlax
library getRange_A02_t01;
import "../../../Utils/expect.dart";
test(List create([int length])) {
check(content, arg) {
List list = create();
list.addAll(content);
Expect.throws(() {list.getRange(0, arg);}, (e) => e is ArgumentError);
}
check(new List(1), -1);
check(new List(1), -(1 << 63));
check([1], -1);
check([1], -(1 << 63));
check(const [1], -1);
check(const [1], -(1 << 63));
check(new List(), -1);
check(new List(), -(1 << 63));
}