Index: trunk/extensions/VisualEditor/tests/es.test.js |
— | — | @@ -0,0 +1,14 @@ |
| 2 | +module( 'es' ); |
| 3 | + |
| 4 | +test( 'es.insertIntoArray', 1, function() { |
| 5 | + var insert = [], i, arr = ['foo', 'bar'], expected = []; |
| 6 | + expected[0] = 'foo'; |
| 7 | + for ( i = 0; i < 3000; i++ ) { |
| 8 | + insert[i] = i; |
| 9 | + expected[i + 1] = i; |
| 10 | + } |
| 11 | + expected[3001] = 'bar'; |
| 12 | + |
| 13 | + es.insertIntoArray( arr, 1, insert ); |
| 14 | + deepEqual( arr, expected, 'splicing 3000 elements into the middle of a 2-element array' ); |
| 15 | +} ); |
Property changes on: trunk/extensions/VisualEditor/tests/es.test.js |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 16 | + native |