Skip to content

Commit c59a0d0

Browse files
committed
Update msd spec
1 parent 5542ae3 commit c59a0d0

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

test/sorting/most-significant-digit/msd.spec.js

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,26 @@ describe('Most-Significant Digit', function () {
99

1010
it('should work with arrays with a single element', function () {
1111
var arr = ['a'];
12-
expect(msd(arr).length).toBe(1);
13-
expect(msd(arr)[0]).toBe('a');
12+
msd(arr);
13+
expect(arr.length).toBe(1);
14+
expect(arr[0]).toBe('a');
1415
});
1516

1617
it('should work with arrays with equally length strings', function () {
17-
var arr = ['a'];
18-
expect(msd(arr).length).toBe(1);
19-
expect(msd(arr)[0]).toBe('a');
18+
var arr = ['bb', 'aa', 'cc'];
19+
msd(arr);
20+
expect(arr.length).toBe(3);
21+
expect(arr[0]).toBe('aa');
22+
expect(arr[1]).toBe('bb');
23+
expect(arr[2]).toBe('cc');
2024
});
2125

22-
26+
it('should work with arrays with equally length strings', function () {
27+
var arr = ['bb', 'aa', 'cc'];
28+
msd(arr);
29+
expect(arr.length).toBe(3);
30+
expect(arr[0]).toBe('aa');
31+
expect(arr[1]).toBe('bb');
32+
expect(arr[2]).toBe('cc');
33+
});
2334
});

0 commit comments

Comments
 (0)