Commit b6313668 authored by Ivan Trubach's avatar Ivan Trubach
Browse files

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.
parent 39ac682f
Loading
Loading
Loading
Loading
+17 −1
Original line number Diff line number Diff line
@@ -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
      '';
    };