Skip to content

Commit

Permalink
tests.dotnet: add test for supported nugetDeps values
Browse files Browse the repository at this point in the history
  • Loading branch information
corngood committed Sep 6, 2024
1 parent e6c700e commit 14c908c
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkgs/test/dotnet/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 { });
}
44 changes: 44 additions & 0 deletions pkgs/test/dotnet/nuget-deps/default.nix
Original file line number Diff line number Diff line change
@@ -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 ];
}
6 changes: 6 additions & 0 deletions pkgs/test/dotnet/nuget-deps/nuget-deps.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# This file was automatically generated by passthru.fetch-deps.
# Please dont edit it manually, your changes might get overwritten!

{ fetchNuGet }:
[
]

0 comments on commit 14c908c

Please sign in to comment.