Skip to content

Commit b21b5e5

Browse files
committed
test(longestIncreasingSubsequence): update tests
1 parent aa9beea commit b21b5e5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/searching/longest-increasing-subsequence.spec.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@ describe('longest subsequence', function () {
1212
sequence = [5, 2, 8, 6, 3, 6, 9, 7, 11];
1313
});
1414

15+
it('should work with empty array', function () {
16+
expect(longestSubsequence([]).length).toBe(0);
17+
});
18+
19+
it('should return the only element in a single element array', function () {
20+
let array = [1];
21+
expect(longestSubsequence(array)).toEqual([1]);
22+
});
23+
1524
it('should give the right length', function () {
1625
expect(longestSubsequence(sequence).length).toBe(5);
1726
});

0 commit comments

Comments
 (0)