diff options
author | h7x4 <h7x4@nani.wtf> | 2023-10-17 01:12:49 +0200 |
---|---|---|
committer | h7x4 <h7x4@nani.wtf> | 2023-10-31 20:25:41 +0100 |
commit | 206d20426cb2959aab8cc3cfc8e62aa68bc7b52f (patch) | |
tree | 9e16017e21242d993fddf9ec37ecf02ac9e8f7e6 /lib/tests/misc.nix | |
parent | f320b0d46ee33f521f50d7c6885605714210e5c9 (diff) |
lib.strings: add `replicate`
`strings.replicate` returns n copies of a string, concatenated into a new string Co-authored-by: Silvan Mosberger <github@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 2e7fda2b1f8b1..1fb857a65e998 100644 --- a/lib/tests/misc.nix +++ b/lib/tests/misc.nix @@ -191,6 +191,11 @@ runTests { expected = "a\nb\nc\n"; }; + testReplicateString = { + expr = strings.replicate 5 "hello"; + expected = "hellohellohellohellohello"; + }; + testSplitStringsSimple = { expr = strings.splitString "." "a.b.c.d"; expected = [ "a" "b" "c" "d" ]; |