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