mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-12-19 06:58:15 +08:00
* feat: add dutchNationalFlagSort implementation * fix: add test, fit code style * fix: add link to directory.md
10 lines
383 B
JavaScript
10 lines
383 B
JavaScript
import { dutchNationalFlagSort } from '../DutchNationalFlagSort'
|
|
|
|
describe('DutchNationalFlagSort', () => {
|
|
it('should sort arrays correctly', () => {
|
|
expect(dutchNationalFlagSort([2, 0, 2, 1, 1, 0])).toEqual([0, 0, 1, 1, 2, 2])
|
|
expect(dutchNationalFlagSort([2, 1, 0])).toEqual([0, 1, 2])
|
|
expect(dutchNationalFlagSort([1, 0, 0, 0, 1])).toEqual([0, 0, 0, 1, 1])
|
|
})
|
|
})
|