aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/gleam/list_test.gleam23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/gleam/list_test.gleam b/test/gleam/list_test.gleam
index 13dbbcb..ec95af4 100644
--- a/test/gleam/list_test.gleam
+++ b/test/gleam/list_test.gleam
@@ -1081,3 +1081,26 @@ pub fn transpose_test() {
list.transpose([[1, 2, 3], [101, 102], [201, 202, 203]])
|> should.equal([[1, 101, 201], [2, 102, 202], [3, 203]])
}
+
+pub fn shuffle_test() {
+ []
+ |> list.shuffle
+ |> should.equal([])
+
+ [1, 1]
+ |> list.shuffle
+ |> should.equal([1, 1])
+
+ [1, 1, 1]
+ |> list.shuffle
+ |> should.equal([1, 1, 1])
+
+ list.range(1, 100)
+ |> list.shuffle
+ |> list.sort(int.compare)
+ |> should.equal(list.range(1, 100))
+
+ // TCO test
+ list.range(0, recursion_test_cycles)
+ |> list.shuffle()
+}