Starting to add tool builder. Extracting bundler file computation.

This commit is contained in:
Judson
2017-05-31 09:44:46 -07:00
parent e4bb4d4788
commit c4fc70f53c
7 changed files with 90 additions and 11 deletions

View File

@@ -3,7 +3,11 @@
equal = expected: actual:
if actual == expected then
(test.passed "= ${toString expected}") else
(test.failed "'${toString actual}'(${builtins.typeOf actual}) != '${toString expected}'(${builtins.typeOf expected})");
(test.failed (
"expected '${toString expected}'(${builtins.typeOf expected})"
+ " != "+
"actual '${toString actual}'(${builtins.typeOf actual})"
));
beASet = actual:
if builtins.isAttrs actual then
@@ -15,7 +19,7 @@
(ex: builtins.any (ac: ex == ac) (builtins.attrNames actual))
expected then
(test.passed "has expected keys") else
(test.failed "keys differ: expected [${lib.concatStringsSep ";" expected}] have [${lib.concatStringsSep ";" (builtins.attrNames actual)}]");
(test.failed "keys differ: expected: [${lib.concatStringsSep ";" expected}] actual: [${lib.concatStringsSep ";" (builtins.attrNames actual)}]");
havePrefix = expected: actual:
if lib.hasPrefix expected actual then

View File

@@ -2,7 +2,7 @@ with builtins;
let
withIndexes = list: genList (idx: (elemAt list idx) // {index = idx;}) (length list);
testLine = report: "${okStr report} ${toString report.index} ${report.description}" + testDirective report + testYaml report;
testLine = report: "${okStr report} ${toString (report.index + 1)} ${report.description}" + testDirective report + testYaml report;
testDirective = report: "";