Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb21b5e5

Browse files
committed
test(longestIncreasingSubsequence): update tests
1 parentaa9beea commitb21b5e5

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+
letarray=[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)

[8]ページ先頭

©2009-2025 Movatter.jp