Skip to content

Commit

Permalink
Add lazy test
Browse files Browse the repository at this point in the history
  • Loading branch information
nvie committed Feb 19, 2024
1 parent 92bc91c commit 72858f1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/more-itertools.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,11 @@ describe("intersperse", () => {
expect(Array.from(intersperse(null, [13, 14]))).toEqual([13, null, 14]);
expect(Array.from(intersperse("foo", [1, 2, 3, 4]))).toEqual([1, "foo", 2, "foo", 3, "foo", 4]);
});

it("intersperse (lazy)", () => {
const lazy = gen([1, 2, 3, 4]);
expect(Array.from(intersperse("foo", lazy))).toEqual([1, "foo", 2, "foo", 3, "foo", 4]);
});
});

describe("itake", () => {
Expand Down

0 comments on commit 72858f1

Please sign in to comment.