lib.splitString: use builtin.split

This commit is contained in:
Etienne Laurin
2020-10-18 10:15:40 +00:00
parent fa0df4d5ab
commit d7464ab4bb
2 changed files with 28 additions and 21 deletions

View File

@@ -154,6 +154,20 @@ runTests {
expected = [ "2001" "db8" "0" "0042" "" "8a2e" "370" "" ];
};
testSplitStringsRegex = {
expr = strings.splitString "\\[{}]()^$?*+|." "A\\[{}]()^$?*+|.B";
expected = [ "A" "B" ];
};
testSplitStringsDerivation = {
expr = take 3 (strings.splitString "/" (derivation {
name = "name";
builder = "builder";
system = "system";
}));
expected = ["" "nix" "store"];
};
testSplitVersionSingle = {
expr = versions.splitVersion "1";
expected = [ "1" ];