Skip to content

Commit

Permalink
Merge #264581: formats.libconfig: fix store path dependency in test
Browse files Browse the repository at this point in the history
  • Loading branch information
vcunat committed Nov 1, 2023
2 parents d9493be + faf4e7b commit de4eef2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions pkgs/pkgs-lib/formats/libconfig/test/comprehensive/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,9 @@ let
val = 1;
};

include_file = (writeText "libconfig-test-include" ''
include_file = writeText "libconfig-test-include" ''
val=1;
'').overrideAttrs {
outputHashAlgo = "sha256";
outputHashMode = "flat";
};
'';

expression = {
simple_top_level_attr = "1.0";
Expand Down Expand Up @@ -63,12 +60,15 @@ in

doCheck = true;
checkPhase = ''
diff -U3 ${./expected.txt} ${libconfig-test-cfg}
cp ${./expected.txt} expected.txt
substituteInPlace expected.txt \
--subst-var-by include_file "${include_file}"
diff -U3 ./expected.txt ${libconfig-test-cfg}
'';

installPhase = ''
mkdir $out
cp ${./expected.txt} $out/expected.txt
cp expected.txt $out
cp ${libconfig-test-cfg} $out/libconfig-test.cfg
cp ${libconfig-test-cfg.passthru.json} $out/libconfig-test.json
'';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
array1d=[1, 5, 2];array2d=([1, 2], [2, 1]);list1d=(1, "mixed!", 5, 2);list2d=(1, (1, 1.2, "foo"), ("bar", 1.2, 1));nasty_string="\"@
\\ ^*bf
0\";'''$";nested={attrset={has={a={integer={value=100;};};};};};simple_top_level_attr="1.0";some_floaty=29.95;weirderTypes={
@include "/nix/store/jdz5yhzbbj4j77yrr7l20x1cs4kbwkj2-libconfig-test-include"
@include "@include_file@"
array_of_ints=[0732, 0xa3, 1234];bigint=9223372036854775807;float=0.0012;hex=0x1fc3;list_of_weird_types=(3.141592654, 9223372036854775807, 0x1fc3, 027, 1.2e-32, 1.0);octal=027;pi=3.141592654;};

0 comments on commit de4eef2

Please sign in to comment.