mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 15:03:28 +00:00
concatText: test now works
This commit is contained in:
parent
6f0eae6d37
commit
5187d2cd8f
@ -1,18 +1,11 @@
|
||||
{ callPackage, lib, pkgs, runCommand, writeText, writeStringReferencesToFile }:
|
||||
{ callPackage, lib, pkgs, runCommand, concatText, writeText, hello }:
|
||||
let
|
||||
sample = import ./sample.nix { inherit pkgs; };
|
||||
samplePaths = lib.unique (lib.attrValues sample);
|
||||
str2drv = x: "${x}";
|
||||
sampleText = concatText "cample-concat" (lib.unique (map str2drv samplePaths));
|
||||
stringReferencesText =
|
||||
writeStringReferencesToFile
|
||||
((lib.concatMapStringsSep "fillertext"
|
||||
stri
|
||||
(lib.attrValues sample)) + ''
|
||||
STORE=${builtins.storeDir};\nsystemctl start bar-foo.service
|
||||
'');
|
||||
stri = writeText "pathToTest";
|
||||
txt1 = stri "abc";
|
||||
txt2 = stri hello;
|
||||
res = concatText "textToTest" [ txt1 txt2 ];
|
||||
in
|
||||
runCommand "test-writeStringReferencesToFile" { } ''
|
||||
diff -U3 <(sort ${stringReferencesText}) <(sort ${sampleText})
|
||||
runCommand "test-concatPaths" { } ''
|
||||
diff -U3 <(cat ${txt1} ${txt2}) ${res}
|
||||
touch $out
|
||||
''
|
||||
|
@ -57,6 +57,7 @@ with pkgs;
|
||||
writeStringReferencesToFile = callPackage ../build-support/trivial-builders/test/writeStringReferencesToFile.nix {};
|
||||
references = callPackage ../build-support/trivial-builders/test/references.nix {};
|
||||
overriding = callPackage ../build-support/trivial-builders/test-overriding.nix {};
|
||||
concat = callPackage ../build-support/trivial-builders/test/concat-test.nix {};
|
||||
};
|
||||
|
||||
writers = callPackage ../build-support/writers/test.nix {};
|
||||
|
Loading…
Reference in New Issue
Block a user