mirror of
https://github.com/dart-lang/sdk
synced 2024-10-06 16:31:07 +00:00
Forgotten last patch-set for landed CL
The https://dart-review.googlesource.com/c/sdk/+/371100 should have included this change, but I somehow managed to not include it in the upload. CoreLibraryReviewExempt: Would have been part of accepted CL Change-Id: Ia9d133ef753413d4804d04db2478e73709e5e5ca Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372440 Reviewed-by: Martin Kustermann <kustermann@google.com> Commit-Queue: Lasse Nielsen <lrn@google.com>
This commit is contained in:
parent
4908814f3a
commit
001e5b3435
|
@ -11,10 +11,10 @@ import 'package:expect/variations.dart';
|
|||
// * `offsetInBytes`
|
||||
// * `lengthInBytes`
|
||||
// * `elementSizeInBytes`
|
||||
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
@pragma('dart2js:noInline')
|
||||
confuse(x) => x;
|
||||
//
|
||||
// The new `TypedDataList` has these and the `List` interface.
|
||||
// Testing that all the typed data types have the members, and that if they
|
||||
// are lists, their list length matches their typed-data view size.
|
||||
|
||||
void test(TypedData data, int bytesPerElement, int lengthInBytes) {
|
||||
var type = data.runtimeType.toString();
|
||||
|
@ -26,6 +26,9 @@ void test(TypedData data, int bytesPerElement, int lengthInBytes) {
|
|||
if (data is TypedDataList) {
|
||||
Expect.equals(
|
||||
lengthInBytes ~/ bytesPerElement, data.length, "$type.length");
|
||||
} else {
|
||||
// Only `ByteData` is not a `TypedDataList`.
|
||||
Expect.type<ByteData>(data);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue