From 9f75e81c5f91aa4236f86c29437de190503ad586 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 18 Jun 2017 15:36:18 +0200 Subject: lib: add test and testString --- lib/default.nix | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/default.nix') diff --git a/lib/default.nix b/lib/default.nix index 9399a010..803a614a 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -29,6 +29,10 @@ let setAttr = name: value: set: set // { ${name} = value; }; + test = re: x: isString x && testString re x; + + testString = re: x: match re x != null; + toC = x: let type = typeOf x; reject = throw "cannot convert ${type}"; -- cgit v1.2.3