better logging

This commit is contained in:
tristan 2024-01-02 13:41:24 +00:00
parent 0dd646775e
commit 32a3950d16
2 changed files with 4 additions and 14 deletions

View file

@ -1,4 +1,5 @@
name: name:
builtins.trace "testing ${name}"
map ({ map ({
msg, msg,
success, success,

View file

@ -24,22 +24,11 @@ msg: {
then builtins.removeAttrs v ["__toString" "__functor"] then builtins.removeAttrs v ["__toString" "__functor"]
else v; else v;
out =
if safeToPrint
then
builtins.toJSON (undunder (
if throws
then (builtins.tryEval actual).value
else {
inherit actual expected;
}
))
else ''{"msg": "cannot be stringified ):"}'';
success = success =
if throws builtins.trace "testing if it ${msg}"
( if throws
then (builtins.tryEval actual).success == false then (builtins.tryEval actual).success == false
else (a == e); else (a == e) );
in in
{ {
inherit success msg; inherit success msg;