diff options
author | h7x4 <h7x4@nani.wtf> | 2022-12-17 21:57:17 +0100 |
---|---|---|
committer | h7x4 <h7x4@nani.wtf> | 2023-02-06 20:40:47 +0100 |
commit | 7c4abbf80e1471d7844aae825f6d1015ce315a48 (patch) | |
tree | 4732d1dfe37370875eed0d8317d02b7b4237948e /lib/tests/misc.nix | |
parent | 41169b15c53350d893d3715cf19eed598d3dbec1 (diff) | |
download | nixpkgs-7c4abbf80e1471d7844aae825f6d1015ce315a48.tar nixpkgs-7c4abbf80e1471d7844aae825f6d1015ce315a48.tar.gz nixpkgs-7c4abbf80e1471d7844aae825f6d1015ce315a48.tar.bz2 nixpkgs-7c4abbf80e1471d7844aae825f6d1015ce315a48.tar.lz nixpkgs-7c4abbf80e1471d7844aae825f6d1015ce315a48.tar.xz nixpkgs-7c4abbf80e1471d7844aae825f6d1015ce315a48.tar.zst nixpkgs-7c4abbf80e1471d7844aae825f6d1015ce315a48.zip |
lib.lists: add `replicate`
`replicate` returns n copies of an element as a list. Co-Authored-By: Silvan Mosberger <contact@infinisil.com>
Diffstat (limited to 'lib/tests/misc.nix')
-rw-r--r-- | lib/tests/misc.nix | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/tests/misc.nix b/lib/tests/misc.nix index c719fcf5d4f..7e52a2e8f0a 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; |