tests.dotnet: add test for supported nugetDeps values

This commit is contained in:
David McFarland 2024-09-06 13:37:42 -03:00
parent e6c700ed11
commit 14c908cdc9
3 changed files with 51 additions and 0 deletions

View File

@ -5,4 +5,5 @@
use-dotnet-from-env = lib.recurseIntoAttrs (callPackage ./use-dotnet-from-env { });
structured-attrs = lib.recurseIntoAttrs (callPackage ./structured-attrs { });
final-attrs = lib.recurseIntoAttrs (callPackage ./final-attrs { });
nuget-deps = lib.recurseIntoAttrs (callPackage ./nuget-deps { });
}

View File

@ -0,0 +1,44 @@
# Tests that `nugetDeps` in buildDotnetModule can handle various types.
{
lib,
dotnet-sdk,
buildPackages, # buildDotnetModule
runCommand,
}:
let
inherit (lib)
mapAttrs
;
inherit (buildPackages)
emptyDirectory
buildDotnetModule
;
in
mapAttrs
(
name: nugetDeps:
buildDotnetModule {
name = "nuget-deps-${name}";
unpackPhase = ''
runHook preUnpack
mkdir test
cd test
dotnet new console -o .
ls -l
runHook postUnpack
'';
inherit nugetDeps;
}
)
{
"null" = null;
"file" = ./nuget-deps.nix;
"derivation" = emptyDirectory;
"list" = [ emptyDirectory ];
}

View File

@ -0,0 +1,6 @@
# This file was automatically generated by passthru.fetch-deps.
# Please dont edit it manually, your changes might get overwritten!
{ fetchNuGet }:
[
]