587713944a
GitOrigin-RevId: 6143fc5eeb9c4f00163267708e26191d1e918932
23 lines
614 B
Nix
23 lines
614 B
Nix
{ lib
|
|
, runCommandLocal
|
|
# Test targets
|
|
, writeClosure
|
|
, samples
|
|
}:
|
|
runCommandLocal "test-trivial-builders-writeClosure-union" {
|
|
__structuredAttrs = true;
|
|
closures = lib.mapAttrs (n: v: writeClosure [ v ]) samples;
|
|
collectiveClosure = writeClosure (lib.attrValues samples);
|
|
inherit samples;
|
|
meta.maintainers = with lib.maintainers; [
|
|
ShamrockLee
|
|
];
|
|
} ''
|
|
set -eu -o pipefail
|
|
echo >&2 Testing mixed closures...
|
|
echo >&2 Checking all samples "(''${samples[*]})" "$collectiveClosure"
|
|
diff -U3 \
|
|
<(sort <"$collectiveClosure") \
|
|
<(cat "''${closures[@]}" | sort | uniq)
|
|
touch "$out"
|
|
''
|