mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-23 00:22:19 +01:00
15 lines
517 B
TypeScript
15 lines
517 B
TypeScript
|
import { CyclicIterator } from './cyclicIterator';
|
||
|
|
||
|
test('loops around the list', () => {
|
||
|
const iterator = new CyclicIterator<number>([1, 3, 5, 7]);
|
||
|
expect(iterator.next()).toEqual(1);
|
||
|
expect(iterator.next()).toEqual(3);
|
||
|
expect(iterator.next()).toEqual(5);
|
||
|
expect(iterator.next()).toEqual(7);
|
||
|
expect(iterator.next()).toEqual(1);
|
||
|
expect(iterator.next()).toEqual(3);
|
||
|
expect(iterator.next()).toEqual(5);
|
||
|
expect(iterator.next()).toEqual(7);
|
||
|
expect(iterator.next()).toEqual(1);
|
||
|
});
|