OLD | NEW |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 #import('dart:scalarlist'); |
| 6 |
1 class ByteArrayTest { | 7 class ByteArrayTest { |
2 static testInt8List() { | 8 static testInt8List() { |
3 Expect.throws(() { new Int8List(-1); }, | 9 Expect.throws(() { new Int8List(-1); }, |
4 (e) { return e is IllegalArgumentException; }); | 10 (e) { return e is IllegalArgumentException; }); |
5 var array = new Int8List(10); | 11 var array = new Int8List(10); |
6 Expect.isTrue(array is List<int>); | 12 Expect.isTrue(array is List<int>); |
7 Expect.equals(10, array.length); | 13 Expect.equals(10, array.length); |
8 Expect.equals(1, array.bytesPerElement()); | 14 Expect.equals(1, array.bytesPerElement()); |
9 Expect.equals(10, array.lengthInBytes()); | 15 Expect.equals(10, array.lengthInBytes()); |
10 Expect.listEquals([0, 0, 0, 0, 0, | 16 Expect.listEquals([0, 0, 0, 0, 0, |
(...skipping 2249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2260 testInt64ListView(); | 2266 testInt64ListView(); |
2261 testUint64ListView(); | 2267 testUint64ListView(); |
2262 testFloat32ListView(); | 2268 testFloat32ListView(); |
2263 testFloat64ListView(); | 2269 testFloat64ListView(); |
2264 } | 2270 } |
2265 } | 2271 } |
2266 | 2272 |
2267 main() { | 2273 main() { |
2268 ByteArrayTest.testMain(); | 2274 ByteArrayTest.testMain(); |
2269 } | 2275 } |
OLD | NEW |