From d7464ab4bbb83694587bb2e217c032e0a6c0fd98 Mon Sep 17 00:00:00 2001 From: Etienne Laurin Date: Sun, 18 Oct 2020 10:15:40 +0000 Subject: lib.splitString: use builtin.split --- lib/tests/misc.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'lib/tests') diff --git a/lib/tests/misc.nix b/lib/tests/misc.nix index 3a6db53c276d..6175f15819a7 100644 --- a/lib/tests/misc.nix +++ b/lib/tests/misc.nix @@ -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" ]; -- cgit v1.2.3