From feef4d0931e2b1c68e9a285eb6f1c3fa71e76e13 Mon Sep 17 00:00:00 2001 From: derped Date: Sat, 30 Nov 2024 17:22:51 +0100 Subject: [PATCH] Add test for pluginWrapper with fn input and tests for lazyPluginClosure. --- tests/lazyUtils.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/lazyUtils.nix b/tests/lazyUtils.nix index 07e4f44..36b2f2a 100644 --- a/tests/lazyUtils.nix +++ b/tests/lazyUtils.nix @@ -120,6 +120,10 @@ in dir = miniDrv; }; }; + testFn = { + expr = (lazyUtils.helpers.pluginWrapper (_: "test")).dir null; + expected = "test"; + }; testSet = { expr = lazyUtils.helpers.pluginWrapper { }; expected = { }; @@ -130,4 +134,14 @@ in }; }; }; + lazyPluginClosure = { + testShort = { + expr = lazyUtils.lazyPluginClosure "pluginName"; + expected = ''{"pluginName",name = "pluginName"}''; + }; + testDrv = { + expr = lazyUtils.lazyPluginClosure miniDrv; + expected = ''{dir = "${miniDrv.outPath}",name = "${miniDrv.name}"}''; + }; + }; }