writers/test: Refactor
It now also checks the executable bit.
This commit is contained in:
parent
e64f987fd6
commit
a6622bf00a
@ -7,6 +7,7 @@
|
|||||||
, python3Packages
|
, python3Packages
|
||||||
, pypy3Packages
|
, pypy3Packages
|
||||||
, runCommand
|
, runCommand
|
||||||
|
, testers
|
||||||
, writers
|
, writers
|
||||||
, writeText
|
, writeText
|
||||||
}:
|
}:
|
||||||
@ -36,14 +37,7 @@ let
|
|||||||
let
|
let
|
||||||
expectedFile = writeText "${file.name}-expected" expected;
|
expectedFile = writeText "${file.name}-expected" expected;
|
||||||
in
|
in
|
||||||
runCommand "run-${file.name}" {} ''
|
testers.testEqualContents { expected = expectedFile; actual = file; assertion = "${file.name} matches"; };
|
||||||
if ! diff -u ${file} ${expectedFile}; then
|
|
||||||
echo 'test ${file.name} failed'
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
touch $out
|
|
||||||
'';
|
|
||||||
in
|
in
|
||||||
lib.recurseIntoAttrs {
|
lib.recurseIntoAttrs {
|
||||||
bin = lib.recurseIntoAttrs {
|
bin = lib.recurseIntoAttrs {
|
||||||
|
Loading…
Reference in New Issue
Block a user