depot/third_party/nixpkgs/pkgs/build-support/trivial-builders/test/concat-test.nix
Default email 5ca88bfbb9 Project import generated by Copybara.
GitOrigin-RevId: 9f918d616c5321ad374ae6cb5ea89c9e04bf3e58
2024-07-31 10:19:44 +00:00

12 lines
348 B
Nix

{ runCommand, concatText, writeText, hello, emptyFile }:
let
stri = writeText "pathToTest";
txt1 = stri "abc";
txt2 = stri (builtins.toString hello);
res = concatText "textToTest" [ txt1 txt2 ];
in
runCommand "test-concatPaths" { } ''
diff -U3 <(cat ${txt1} ${txt2}) ${res}
diff -U3 ${concatText "void" []} ${emptyFile}
touch $out
''