-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Cody Casterline
committed
Jul 16, 2023
1 parent
a4b0581
commit c063c51
Showing
3 changed files
with
171 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { assertEquals } from "https://deno.land/[email protected]/testing/asserts.ts"; | ||
import { range } from "../mod.ts"; | ||
import { testBoth } from "./helpers.ts"; | ||
|
||
|
||
Deno.test(async function repeats(t) { | ||
await testBoth(t, () => range({to: 4}), async (iter) => { | ||
let result = await iter.repeat(3).toArray() | ||
assertEquals(result, [0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3]) | ||
}) | ||
}) | ||
|
||
Deno.test(async function loops(t) { | ||
await testBoth(t, () => range({to: 4}), async (iter) => { | ||
let result = await iter.loop().skip(2).limit(11).toArray() | ||
assertEquals(result, [2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0]) | ||
}) | ||
}) |