mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 04:27:17 +00:00
e7d4c48a80
Change-Id: I9a51ae6a1f8f4d018da289b6f29ab18053304c19 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132341 Commit-Queue: Erik Ernst <eernst@google.com> Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
23 lines
648 B
Dart
23 lines
648 B
Dart
// Copyright (c) 2014, 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.
|
|
|
|
import 'dart:typed_data';
|
|
import 'package:expect/expect.dart';
|
|
import 'setRange_lib.dart';
|
|
|
|
clampingTest() {
|
|
var a1 = new Int8List(8);
|
|
var a2 = new Uint8ClampedList.view(a1.buffer);
|
|
initialize(a1);
|
|
Expect.equals('[1, 2, 3, 4, 5, 6, 7, 8]', '$a1');
|
|
Expect.equals('[1, 2, 3, 4, 5, 6, 7, 8]', '$a2');
|
|
a1[0] = -1;
|
|
a2.setRange(0, 2, a1);
|
|
Expect.equals('[0, 2, 3, 4, 5, 6, 7, 8]', '$a2');
|
|
}
|
|
|
|
main() {
|
|
clampingTest();
|
|
}
|