OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 var assert = chai.assert; | 5 var assert = chai.assert; |
6 | 6 |
7 suite('generic', () => { | 7 suite('generic', () => { |
8 "use strict"; | 8 "use strict"; |
9 | 9 |
10 let generic = dart.generic; | 10 let generic = dart.generic; |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 let n = 42; | 384 let n = 42; |
385 let intHash = dart.hashCode(n); | 385 let intHash = dart.hashCode(n); |
386 checkType(intHash, core.int); | 386 checkType(intHash, core.int); |
387 | 387 |
388 let intString = dart.toString(n); | 388 let intString = dart.toString(n); |
389 assert.equal(intString, '42'); | 389 assert.equal(intString, '42'); |
390 let intType = dart.runtimeType(n); | 390 let intType = dart.runtimeType(n); |
391 assert.equal(intType, core.int); | 391 assert.equal(intType, core.int); |
392 }); | 392 }); |
393 }); | 393 }); |
| 394 |
| 395 suite('primitives', function() { |
| 396 'use strict'; |
| 397 |
| 398 test('fixed length list', () => { |
| 399 let list = new core.List(10); |
| 400 list[0] = 42; |
| 401 assert.throws(() => list.add(42)); |
| 402 }); |
| 403 }); |
OLD | NEW |