Skip to content

Commit 5542ae3

Browse files
committed
Add msd spec
1 parent 49e965d commit 5542ae3

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
var msd = require('../../../src/sorting/most-significant-digit/msd.js').msd;
2+
3+
describe('Most-Significant Digit', function () {
4+
'use strict';
5+
6+
it('should work with empty arrays', function () {
7+
expect(msd([]).length).toBe(0);
8+
});
9+
10+
it('should work with arrays with a single element', function () {
11+
var arr = ['a'];
12+
expect(msd(arr).length).toBe(1);
13+
expect(msd(arr)[0]).toBe('a');
14+
});
15+
16+
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');
20+
});
21+
22+
23+
});

0 commit comments

Comments
 (0)