From 2d4352b1ae57a06670b451f1b4426beff9796628 Mon Sep 17 00:00:00 2001 From: Joachim Fasting Date: Tue, 24 Sep 2019 11:27:14 +0200 Subject: [PATCH] lib: basic tests for lib.versions --- lib/tests/misc.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/tests/misc.nix b/lib/tests/misc.nix index d8f412d3fc49..e5d76d4e57b7 100644 --- a/lib/tests/misc.nix +++ b/lib/tests/misc.nix @@ -102,6 +102,21 @@ runTests { expected = [ "2001" "db8" "0" "0042" "" "8a2e" "370" "" ]; }; + testSplitVersionSingle = { + expr = versions.splitVersion "1"; + expected = [ "1" ]; + }; + + testSplitVersionDouble = { + expr = versions.splitVersion "1.2"; + expected = [ "1" "2" ]; + }; + + testSplitVersionTriple = { + expr = versions.splitVersion "1.2.3"; + expected = [ "1" "2" "3" ]; + }; + testIsStorePath = { expr = let goodPath =