This repository has been archived on 2022-03-12. You can view files and clone it, but cannot push or open issues or pull requests.
Lateinicus/frontend/src/utils/__test__/queue.test.ts

17 lines
370 B
TypeScript
Raw Normal View History

2018-09-15 13:40:42 +00:00
import { Queue } from "../queue";
test("Enqueue a, b and c and dequeue them", () => {
const q: Queue = new Queue<string>();
q.enqueue("a");
q.enqueue("b");
q.enqueue("c");
expect(q.size()).toBe(3);
expect(q.dequeue()).toEqual("a");
expect(q.dequeue()).toEqual("b");
expect(q.dequeue()).toEqual("c");
expect(q.size()).toBe(0);
});