2024-01-02 11:29:13 +00:00
|
|
|
{ callPackage, lib, pkgs, runCommand, samples, writeText, writeStringReferencesToFile }:
|
2021-12-06 16:07:01 +00:00
|
|
|
let
|
2024-01-02 11:29:13 +00:00
|
|
|
samplePaths = lib.unique (lib.attrValues samples);
|
2021-12-06 16:07:01 +00:00
|
|
|
stri = x: "${x}";
|
|
|
|
sampleText = writeText "sample-text" (lib.concatStringsSep "\n" (lib.unique (map stri samplePaths)));
|
|
|
|
stringReferencesText =
|
|
|
|
writeStringReferencesToFile
|
|
|
|
((lib.concatMapStringsSep "fillertext"
|
|
|
|
stri
|
2024-01-02 11:29:13 +00:00
|
|
|
(lib.attrValues samples)) + ''
|
2021-12-06 16:07:01 +00:00
|
|
|
STORE=${builtins.storeDir};\nsystemctl start bar-foo.service
|
|
|
|
'');
|
|
|
|
in
|
|
|
|
runCommand "test-writeStringReferencesToFile" { } ''
|
|
|
|
diff -U3 <(sort ${stringReferencesText}) <(sort ${sampleText})
|
|
|
|
touch $out
|
|
|
|
''
|