From 7c4abbf80e1471d7844aae825f6d1015ce315a48 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Sat, 17 Dec 2022 21:57:17 +0100 Subject: lib.lists: add `replicate` `replicate` returns n copies of an element as a list. Co-Authored-By: Silvan Mosberger --- lib/tests/misc.nix | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/tests/misc.nix') diff --git a/lib/tests/misc.nix b/lib/tests/misc.nix index c719fcf5d4fa..7e52a2e8f0ab 100644 --- a/lib/tests/misc.nix +++ b/lib/tests/misc.nix @@ -459,6 +459,11 @@ runTests { expected = [2 30 40 42]; }; + testReplicate = { + expr = replicate 3 "a"; + expected = ["a" "a" "a"]; + }; + testToIntShouldConvertStringToInt = { expr = toInt "27"; expected = 27; -- cgit 1.4.1