diff options
author | Louis Pilfold <louis@lpil.uk> | 2019-05-10 14:15:26 +0100 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2019-05-10 14:15:26 +0100 |
commit | dd4c4d9e0e45a487f89cf98bfc24855990e4a8a5 (patch) | |
tree | 770a2ba4bdf6f6e36fd9bcd8d6d99fa7ac0b5f7e /test | |
parent | e1f4d26f3ee2e765c87b02c96950c9e0cb1d8bde (diff) | |
download | gleam_stdlib-dd4c4d9e0e45a487f89cf98bfc24855990e4a8a5.tar.gz gleam_stdlib-dd4c4d9e0e45a487f89cf98bfc24855990e4a8a5.zip |
list:range
Diffstat (limited to 'test')
-rw-r--r-- | test/list_test.gleam | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/list_test.gleam b/test/list_test.gleam index ba5c4c5..81f2427 100644 --- a/test/list_test.gleam +++ b/test/list_test.gleam @@ -261,3 +261,23 @@ pub fn index_map_test() { list:index_map(["a", "b", "c"], f) |> expect:equal(_, ["a0", "b1", "c2"]) } + +pub fn range_test() { + list:range(0, 0) + |> expect:equal(_, []) + + list:range(1, 1) + |> expect:equal(_, []) + + list:range(-1, -1) + |> expect:equal(_, []) + + list:range(0, 1) + |> expect:equal(_, [0]) + + list:range(0, 5) + |> expect:equal(_, [0, 1, 2, 3, 4]) + + list:range(1, -5) + |> expect:equal(_, [1, 0, -1, -2, -3, -4]) +} |