From 1d91cb03285269794823843e54ae3dbb43e7c4d6 Mon Sep 17 00:00:00 2001 From: Brett Snyder Date: Sat, 11 May 2019 09:28:11 -0500 Subject: list:repeat --- test/list_test.gleam | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test') 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"]) +} -- cgit v1.2.3