blob: 9f31c5c726442212a0909ae1f706c27b56a25550 [file] [log] [blame]
// 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.
/// @assertion void setAll(int index, Iterable<E> iterable)
/// ...
/// The index must be non-negative and no greater than length.
/// @description Checks that an error is thrown if [index] is out of bounds.
/// @author msyabro
import "dart:typed_data";
import "../../../Utils/expect.dart";
check(List<int> list) {
var l = new Uint16List.fromList(list);
Expect.throws(() {
l.setAll(-1, []);
});
Expect.throws(() {
l.setAll(list.length + 1, []);
});
Expect.throws(() {
l.setAll(0x80000000, []);
});
Expect.throws(() {
l.setAll(0x7fffffff, []);
});
}
main() {
check([]);
check([1]);
check([0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
}