mirror of
https://gitlab.com/TECHNOFAB/nixtest.git
synced 2025-12-12 02:00:18 +01:00
fix: pretty print expected aswell when format is "pretty"
This commit is contained in:
parent
4aaaf32621
commit
9068477650
2 changed files with 13 additions and 1 deletions
|
|
@ -99,6 +99,13 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
name = "pretty-unit";
|
||||||
|
format = "pretty";
|
||||||
|
pos = __curPos;
|
||||||
|
expected = pkgs.hello;
|
||||||
|
actual = pkgs.hello;
|
||||||
|
}
|
||||||
{
|
{
|
||||||
name = "test-drv";
|
name = "test-drv";
|
||||||
pos = __curPos;
|
pos = __curPos;
|
||||||
|
|
|
||||||
|
|
@ -19,9 +19,14 @@
|
||||||
if format == "json"
|
if format == "json"
|
||||||
then actual
|
then actual
|
||||||
else lib.generators.toPretty {} actual;
|
else lib.generators.toPretty {} actual;
|
||||||
|
expected' =
|
||||||
|
if format == "json"
|
||||||
|
then expected
|
||||||
|
else lib.generators.toPretty {} expected;
|
||||||
in {
|
in {
|
||||||
inherit type name description expected;
|
inherit type name description;
|
||||||
actual = actual';
|
actual = actual';
|
||||||
|
expected = expected';
|
||||||
# discard string context, otherwise it's being built instantly which we don't want
|
# discard string context, otherwise it's being built instantly which we don't want
|
||||||
actualDrv = builtins.unsafeDiscardStringContext (actualDrv.drvPath or "");
|
actualDrv = builtins.unsafeDiscardStringContext (actualDrv.drvPath or "");
|
||||||
pos =
|
pos =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue