Skip to content

Commit 4fd02bc

Browse files
committed
add: test cases for out-of-range index
1 parent 18c5a96 commit 4fd02bc

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/immutable_sequence.test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@ describe('Immutable Sequence', function () {
2929
var s = ImmutableSequence.fromArray([1, 2, 3]);
3030
s.get(0).should.eql(1);
3131
s.get(1).should.eql(2);
32+
});
33+
34+
it('should throw an error when the index is out of range', function () {
35+
var s = ImmutableSequence.fromArray([]);
36+
(function () {
37+
s.get(0);
38+
}).should.throw();
39+
40+
s = ImmutableSequence.fromArray([1, 2, 3]);
3241
(function () {
3342
s.get(3);
3443
}).should.throw();

0 commit comments

Comments
 (0)