Restructure cleanCargoToml tests

This commit is contained in:
Ivan Petkov 2021-12-31 18:29:43 -08:00
parent 8d6d973261
commit 6b9ebe7220
No known key found for this signature in database
GPG Key ID: BB6F9EFC065832B6
5 changed files with 7 additions and 19 deletions

View File

@ -3,13 +3,15 @@
, writeTOML
}:
path:
let
cleaned = cleanCargoToml {
cargoToml = ./Cargo.toml;
cargoToml = path + /Cargo.toml;
};
cleanedToml = writeTOML "cleaned.toml" cleaned;
expected = path + /expected.toml;
in
runCommand "compare" { } ''
diff ${./expected.toml} ${cleanedToml}
diff ${expected} ${cleanedToml}
touch $out
''

View File

@ -1,15 +0,0 @@
{ cleanCargoToml
, runCommand
, writeTOML
}:
let
cleaned = cleanCargoToml {
cargoToml = ./Cargo.toml;
};
cleanedToml = writeTOML "cleaned.toml" cleaned;
in
runCommand "compare" { } ''
diff ${./expected.toml} ${cleanedToml}
touch $out
''

View File

@ -12,8 +12,9 @@ pkgs.lib.makeScope myLib.newScope (self:
callPackage = self.newScope { };
in
{
cleanCargoTomlSimple = callPackage ./cleanCargoToml/simple { };
cleanCargoTomlComplex = callPackage ./cleanCargoToml/complex { };
cmpCleanCargoToml = callPackage ./cleanCargoToml { };
cmpCleanCargoTomlSimple = self.cmpCleanCargoToml ./cleanCargoToml/barebones;
cmpCleanCargoTomlComplex = self.cmpCleanCargoToml ./cleanCargoToml/complex;
compilesFresh = callPackage ./compilesFresh.nix { };
compilesFreshSimple = self.compilesFresh ./simple "simple";