lib.lists: add replicate
`replicate` returns n copies of an element as a list. Co-Authored-By: Silvan Mosberger <contact@infinisil.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user