Skip to content

Commit 871a49f

Browse files
authored
merge: test case to radixSort Algorithm (TheAlgorithms#968)
1 parent d47555b commit 871a49f

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

Sorts/test/RadixSort.test.js

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { radixSort } from '../RadixSort'
2+
3+
test('The RadixSort of the array [4, 3, 2, 1] is [1, 2, 3, 4]', () => {
4+
const arr = [4, 3, 2, 1]
5+
const res = radixSort(arr, 10)
6+
expect(res).toEqual([1, 2, 3, 4])
7+
})
8+
9+
test('The RadixSort of the array [] is []', () => {
10+
const arr = []
11+
const res = radixSort(arr, 10)
12+
expect(res).toEqual([])
13+
})
14+
15+
test('The RadixSort of the array [14, 16, 10, 12] is [10, 12, 14, 16]', () => {
16+
const arr = [14, 16, 10, 12]
17+
const res = radixSort(arr, 10)
18+
expect(res).toEqual([10, 12, 14, 16])
19+
})

0 commit comments

Comments
 (0)