|
| 1 | +import { pigeonHoleSort } from '../PigeonHoleSort' |
| 2 | + |
| 3 | +test('The pigeonHoleSort of the array [1, 4, 3, 2] is [1, 2, 3, 4]', () => { |
| 4 | + const arr = [1, 4, 3, 2] |
| 5 | + const res = pigeonHoleSort(arr) |
| 6 | + expect(res).toEqual([1, 2, 3, 4]) |
| 7 | +}) |
| 8 | + |
| 9 | +test('The pigeonHoleSort of the array [5, 4, 1, 2] is [1, 2, 4, 5]', () => { |
| 10 | + const arr = [5, 4, 1, 2] |
| 11 | + const res = pigeonHoleSort(arr) |
| 12 | + expect(res).toEqual([1, 2, 4, 5]) |
| 13 | +}) |
| 14 | + |
| 15 | +test('The pigeonHoleSort of the array [18, 31, 29, 35, 11] is [11, 18, 29, 31, 35]', () => { |
| 16 | + const arr = [18, 31, 29, 35, 11] |
| 17 | + const res = pigeonHoleSort(arr) |
| 18 | + expect(res).toEqual([11, 18, 29, 31, 35]) |
| 19 | +}) |
0 commit comments