blob: b6172ac4d5ccf78c1b5c50c69f16ca8825a2e4e2 [file] [log] [blame]
// Copyright (c) 2017, 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 void length=(int newLength)
/// Changes the length of this list.
/// ...
/// Throws an UnsupportedError if the list is fixed-length.
/// @description Checks that UnsupportedError is thrown as a Float64x2List is a
/// fixed-length list.
/// @author ngl@unipro.ru
import "dart:typed_data";
import "../../../Utils/expect.dart";
Float64x2 f64x2(v) => new Float64x2.splat(v);
void check(List<Float64x2> list) {
var l = new Float64x2List.fromList(list);
try {
l.length = 2;
Expect.fail("This opetation shouldn't be supported");
} on UnsupportedError {}
Expect.equals(list.length, l.length);
}
main() {
check([f64x2(1.0)]);
check([f64x2(1.0), f64x2(2.0), f64x2(3.0), f64x2(4.0), f64x2(5.0)]);
check([
f64x2(1.0), f64x2(0.0), f64x2(0.0), f64x2(0.0), f64x2(0.0), f64x2(0.0),
f64x2(0.0), f64x2(0.0), f64x2(0.0), f64x2(0.0), f64x2(0.0), f64x2(0.0),
f64x2(0.0), f64x2(0.0), f64x2(0.0)
]);
}