|
| 1 | +import { oddEvenSort } from '../OddEvenSort' |
| 2 | + |
| 3 | +test('The OddEvenSort of the array [5, 4, 3, 2, 1] is [1, 2, 3, 4, 5]', () => { |
| 4 | + const arr = [5, 4, 3, 2, 1] |
| 5 | + const res = oddEvenSort(arr) |
| 6 | + expect(res).toEqual([1, 2, 3, 4, 5]) |
| 7 | +}) |
| 8 | + |
| 9 | +test('The OddEvenSort of the array [] is []', () => { |
| 10 | + const arr = [] |
| 11 | + const res = oddEvenSort(arr) |
| 12 | + expect(res).toEqual([]) |
| 13 | +}) |
| 14 | + |
| 15 | +test('The OddEvenSort of the array [10, 14, 12, 20] is [10, 12, 14, 20]', () => { |
| 16 | + const arr = [10, 14, 12, 20] |
| 17 | + const res = oddEvenSort(arr) |
| 18 | + expect(res).toEqual([10, 12, 14, 20]) |
| 19 | +}) |
| 20 | + |
| 21 | +test('The OddEvenSort of the array [166, 169, 144] is [144, 166, 169]', () => { |
| 22 | + const arr = [166, 169, 144] |
| 23 | + const res = oddEvenSort(arr) |
| 24 | + expect(res).toEqual([144, 166, 169]) |
| 25 | +}) |
0 commit comments