core/pkgs/build-support/trivial-builders/test/concat-test.nix

13 lines
352 B
Nix
Raw Normal View History

2024-05-02 00:46:19 +00:00
{ callPackage, lib, pkgs, runCommand, concatText, writeText, hello, emptyFile }:
let
stri = writeText "pathToTest";
txt1 = stri "abc";
txt2 = stri hello;
res = concatText "textToTest" [ txt1 txt2 ];
in
runCommand "test-concatPaths" { } ''
diff -U3 <(cat ${txt1} ${txt2}) ${res}
diff -U3 ${concatText "void" []} ${emptyFile}
touch $out
''