OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 // Library tag to be able to run in html test framework. | 5 // Library tag to be able to run in html test framework. |
6 library byte_array_test; | 6 library byte_array_test; |
7 | 7 |
8 import "package:expect/expect.dart"; | 8 import "package:expect/expect.dart"; |
9 import 'dart:typeddata'; | 9 import 'dart:typed_data'; |
10 | 10 |
11 class ByteArrayTest { | 11 class ByteArrayTest { |
12 static testInt8ListImpl(Int8List array) { | 12 static testInt8ListImpl(Int8List array) { |
13 Expect.isTrue(array is List<int>); | 13 Expect.isTrue(array is List<int>); |
14 Expect.equals(10, array.length); | 14 Expect.equals(10, array.length); |
15 Expect.equals(1, array.elementSizeInBytes); | 15 Expect.equals(1, array.elementSizeInBytes); |
16 Expect.equals(10, array.lengthInBytes); | 16 Expect.equals(10, array.lengthInBytes); |
17 Expect.listEquals([0, 0, 0, 0, 0, | 17 Expect.listEquals([0, 0, 0, 0, 0, |
18 0, 0, 0, 0, 0], | 18 0, 0, 0, 0, 0], |
19 array); | 19 array); |
(...skipping 2357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2377 | 2377 |
2378 testByteList(); | 2378 testByteList(); |
2379 } | 2379 } |
2380 } | 2380 } |
2381 | 2381 |
2382 main() { | 2382 main() { |
2383 for (var i=0; i<1000; i++) { | 2383 for (var i=0; i<1000; i++) { |
2384 ByteArrayTest.testMain(); | 2384 ByteArrayTest.testMain(); |
2385 } | 2385 } |
2386 } | 2386 } |
OLD | NEW |