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

12 lines
353 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 ];
2024-05-13 21:24:10 +00:00
in runCommand "test-concatPaths" { } ''
2024-05-02 00:46:19 +00:00
diff -U3 <(cat ${txt1} ${txt2}) ${res}
2024-05-13 21:24:10 +00:00
diff -U3 ${concatText "void" [ ]} ${emptyFile}
2024-05-02 00:46:19 +00:00
touch $out
''