test.testers: add failing tests for testers.testEqualContents

This change adds tests for tests.testEqualContents to demonstrate that
the current implementation is failing in some cases.
This commit is contained in:
Ivan Trubach 2024-07-18 16:28:33 +03:00
parent 39ac682f10
commit b631366870

View File

@ -99,19 +99,35 @@ lib.recurseIntoAttrs {
};
testEqualContents = lib.recurseIntoAttrs {
happy = testers.testEqualContents {
equalDir = testers.testEqualContents {
assertion = "The same directory contents at different paths are recognized as equal";
expected = runCommand "expected" {} ''
mkdir -p $out/c
echo a >$out/a
echo b >$out/b
echo d >$out/c/d
echo e >$out/e
chmod a+x $out/e
'';
actual = runCommand "actual" {} ''
mkdir -p $out/c
echo a >$out/a
echo b >$out/b
echo d >$out/c/d
echo e >$out/e
chmod a+x $out/e
'';
};
equalExe = testers.testEqualContents {
assertion = "The same executable file contents at different paths are recognized as equal";
expected = runCommand "expected" { } ''
echo test >$out
chmod a+x $out
'';
actual = runCommand "actual" { } ''
echo test >$out
chmod a+x $out
'';
};