diff options
Diffstat (limited to 'test/list_test.gleam')
-rw-r--r-- | test/list_test.gleam | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/list_test.gleam b/test/list_test.gleam index ef80223..fb32387 100644 --- a/test/list_test.gleam +++ b/test/list_test.gleam @@ -298,3 +298,17 @@ pub fn range_test() { list:range(1, -5) |> expect:equal(_, [1, 0, -1, -2, -3, -4]) } + +pub fn repeat_test() { + list:repeat(1, -10) + |> expect:equal(_, []) + + list:repeat(1, 0) + |> expect:equal(_, []) + + list:repeat(2, 3) + |> expect:equal(_, [2, 2, 2]) + + list:repeat("x", 5) + |> expect:equal(_, ["x", "x", "x", "x", "x"]) +} |