mirror of
https://gitlab.com/TECHNOFAB/nixtest.git
synced 2025-12-12 02:00:18 +01:00
feat: add support for pretty/nix format
improve handling string test values
This commit is contained in:
parent
0a1bbae2c3
commit
e029fae0b8
4 changed files with 52 additions and 14 deletions
|
|
@ -8,14 +8,20 @@
|
|||
type ? "unit",
|
||||
name,
|
||||
description ? "",
|
||||
format ? "json",
|
||||
expected ? null,
|
||||
actual ? null,
|
||||
actualDrv ? null,
|
||||
pos ? null,
|
||||
}: let
|
||||
fileRelative = lib.removePrefix ((toString self) + "/") pos.file;
|
||||
actual' =
|
||||
if format == "json"
|
||||
then actual
|
||||
else lib.generators.toPretty {} actual;
|
||||
in {
|
||||
inherit type name description expected actual;
|
||||
inherit type name description expected;
|
||||
actual = actual';
|
||||
# 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