Skip to content

Commit 66c4af4

Browse files
committed
Add bucket sort spec
1 parent 4a78b0b commit 66c4af4

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
var bs =
2+
require('../../../src/sorting/linearsort/bucketsort').bucketSort;
3+
4+
describe('bucketsort', function () {
5+
'use strict';
6+
7+
it('should sort the empty array', function () {
8+
expect(bs([])).toEqual([]);
9+
});
10+
11+
it('should return array with the same count of elements', function () {
12+
expect(bs([2, 3, 4]).length).toBe(3);
13+
});
14+
15+
it('should sort the given array in ascending order', function () {
16+
expect(bs([42, 3, 10])).toEqual([3, 10, 42]);
17+
});
18+
});

0 commit comments

Comments
 (0)