tests.replaceVars: fix group mismatches

This fixes group mismatches observed on Darwin, e.g.:

```
replaceVars-succeeds
--- /nix/store/wahj58fiii5j1jy6s9mpbdyxzhq3plnb-source.txt
+++ /nix/store/bfmykrc9r5ycy0dj8l1z2p9c5116dny8-expected
├── stat {}
│ @@ -1,7 +1,7 @@
│
│    Size: 96        	Blocks: 0          IO Block: 4096   directory
│ -Device: 1,15	Access: (0555/dr-xr-xr-x)  Uid: (    0/    root)   Gid: (    0/   wheel)
│ +Device: 1,15	Access: (0555/dr-xr-xr-x)  Uid: (    0/    root)   Gid: (  350/  nixbld)
│
│  Modify: 1970-01-01 00:00:01.000000000 +0000
```
This commit is contained in:
Michael Daniels
2026-06-14 12:06:11 -04:00
parent 85912a429b
commit 3a5c240ffe
+6 -5
View File
@@ -6,6 +6,7 @@
lib,
runCommand,
testers,
writeText,
}:
let
inherit (testers) testEqualContents testBuildFailure;
@@ -22,7 +23,7 @@ let
};
expected = mkExpectation (
builtins.toFile "source.txt" ''
writeText "source.txt" ''
All human beings are born free and are the same in dignity and rights.
They are endowed with reason and conscience and should act towards
one another in a spirit of shared humanity.
@@ -53,7 +54,7 @@ let
{
failed =
let
src = builtins.toFile "source.txt" ''
src = writeText "source.txt" ''
Header.
before @whatIsThis@ middle @It'sOdd2Me@ after.
@cannot detect due to space@
@@ -86,7 +87,7 @@ let
};
expected = mkExpectation (
builtins.toFile "source.txt" ''
writeText "source.txt" ''
All human beings are born free and are the same in dignity and rights.
They are endowed with reason and conscience and should act towards
one another in a spirit of @brotherhood@.
@@ -101,7 +102,7 @@ let
{
failed =
let
src = builtins.toFile "source.txt" ''
src = writeText "source.txt" ''
@a@
@b@
@c@
@@ -127,7 +128,7 @@ let
{
failed =
let
src = builtins.toFile "source.txt" ''
src = writeText "source.txt" ''
@a@
@b@
'';