Chromium Code Reviews| 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("ByteArrayTest.dart"); | 6 library ByteArrayTest; |
|
Siggi Cherem (dart-lang)
2012/11/08 18:38:19
use lower_case_name to match the filename.
| |
| 7 | 7 |
| 8 #import('dart:scalarlist'); | 8 import 'dart:scalarlist'; |
| 9 | 9 |
| 10 class ByteArrayTest { | 10 class ByteArrayTest { |
| 11 static testInt8List() { | 11 static testInt8List() { |
| 12 Expect.throws(() { new Int8List(-1); }, | 12 Expect.throws(() { new Int8List(-1); }, |
| 13 (e) { return e is ArgumentError; }); | 13 (e) { return e is ArgumentError; }); |
| 14 var array = new Int8List(10); | 14 var array = new Int8List(10); |
| 15 Expect.isTrue(array is List<int>); | 15 Expect.isTrue(array is List<int>); |
| 16 Expect.equals(10, array.length); | 16 Expect.equals(10, array.length); |
| 17 Expect.equals(1, array.bytesPerElement()); | 17 Expect.equals(1, array.bytesPerElement()); |
| 18 Expect.equals(10, array.lengthInBytes()); | 18 Expect.equals(10, array.lengthInBytes()); |
| (...skipping 2250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2269 testInt64ListView(); | 2269 testInt64ListView(); |
| 2270 testUint64ListView(); | 2270 testUint64ListView(); |
| 2271 testFloat32ListView(); | 2271 testFloat32ListView(); |
| 2272 testFloat64ListView(); | 2272 testFloat64ListView(); |
| 2273 } | 2273 } |
| 2274 } | 2274 } |
| 2275 | 2275 |
| 2276 main() { | 2276 main() { |
| 2277 ByteArrayTest.testMain(); | 2277 ByteArrayTest.testMain(); |
| 2278 } | 2278 } |
| OLD | NEW |