mirror of
https://github.com/ipetkov/crane.git
synced 2024-11-22 23:17:15 +03:00
Restructure cleanCargoToml tests
This commit is contained in:
parent
8d6d973261
commit
6b9ebe7220
@ -3,13 +3,15 @@
|
|||||||
, writeTOML
|
, writeTOML
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
path:
|
||||||
let
|
let
|
||||||
cleaned = cleanCargoToml {
|
cleaned = cleanCargoToml {
|
||||||
cargoToml = ./Cargo.toml;
|
cargoToml = path + /Cargo.toml;
|
||||||
};
|
};
|
||||||
cleanedToml = writeTOML "cleaned.toml" cleaned;
|
cleanedToml = writeTOML "cleaned.toml" cleaned;
|
||||||
|
expected = path + /expected.toml;
|
||||||
in
|
in
|
||||||
runCommand "compare" { } ''
|
runCommand "compare" { } ''
|
||||||
diff ${./expected.toml} ${cleanedToml}
|
diff ${expected} ${cleanedToml}
|
||||||
touch $out
|
touch $out
|
||||||
''
|
''
|
@ -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
|
|
||||||
''
|
|
@ -12,8 +12,9 @@ pkgs.lib.makeScope myLib.newScope (self:
|
|||||||
callPackage = self.newScope { };
|
callPackage = self.newScope { };
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
cleanCargoTomlSimple = callPackage ./cleanCargoToml/simple { };
|
cmpCleanCargoToml = callPackage ./cleanCargoToml { };
|
||||||
cleanCargoTomlComplex = callPackage ./cleanCargoToml/complex { };
|
cmpCleanCargoTomlSimple = self.cmpCleanCargoToml ./cleanCargoToml/barebones;
|
||||||
|
cmpCleanCargoTomlComplex = self.cmpCleanCargoToml ./cleanCargoToml/complex;
|
||||||
|
|
||||||
compilesFresh = callPackage ./compilesFresh.nix { };
|
compilesFresh = callPackage ./compilesFresh.nix { };
|
||||||
compilesFreshSimple = self.compilesFresh ./simple "simple";
|
compilesFreshSimple = self.compilesFresh ./simple "simple";
|
||||||
|
Loading…
Reference in New Issue
Block a user