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