aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBrett Snyder <bsnyder@digitalocean.com>2019-05-11 09:28:11 -0500
committerLouis Pilfold <louis@lpil.uk>2019-05-11 16:53:59 +0100
commit1d91cb03285269794823843e54ae3dbb43e7c4d6 (patch)
tree17a61149c5d72eafdd3e8075c31cf3513e2db34f /test
parenteb243dd13cbcdf5f6d37b7e2084414df95d7e0d9 (diff)
downloadgleam_stdlib-1d91cb03285269794823843e54ae3dbb43e7c4d6.tar.gz
gleam_stdlib-1d91cb03285269794823843e54ae3dbb43e7c4d6.zip
list:repeat
Diffstat (limited to 'test')
-rw-r--r--test/list_test.gleam14
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"])
+}