mirror of
https://gitlab.com/TECHNOFAB/nixtest.git
synced 2025-12-12 10:10:09 +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";
|
||||
pos = __curPos;
|
||||
|
|
|
|||
|
|
@ -19,9 +19,14 @@
|
|||
if format == "json"
|
||||
then actual
|
||||
else lib.generators.toPretty {} actual;
|
||||
expected' =
|
||||
if format == "json"
|
||||
then expected
|
||||
else lib.generators.toPretty {} expected;
|
||||
in {
|
||||
inherit type name description expected;
|
||||
inherit type name description;
|
||||
actual = actual';
|
||||
expected = expected';
|
||||
# discard string context, otherwise it's being built instantly which we don't want
|
||||
actualDrv = builtins.unsafeDiscardStringContext (actualDrv.drvPath or "");
|
||||
pos =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue