chore: add nixtest for testing and a couple of tests

This commit is contained in:
technofab 2026-01-04 21:26:08 +01:00
parent e08c48b5db
commit e6c13290bb
Signed by: technofab
SSH key fingerprint: SHA256:bV4h88OqS/AxjbPn66uUdvK9JsgIW4tv3vwJQ8tpMqQ
8 changed files with 281 additions and 0 deletions

49
tests/select_test.nix Normal file
View file

@ -0,0 +1,49 @@
{rensa, ...}: {
suites."Select" = {
pos = __curPos;
tests = [
{
name = "single block";
expected = {
x86_64-linux = {value = "test-value";};
};
actual = let
testFlake = {
__ren = {
cells = ["repo"];
};
x86_64-linux = {
repo = {
docs = {value = "test-value";};
ci = {packages = {value = "ci-packages";};};
};
};
};
in
rensa.select testFlake [["repo" "docs"]];
}
{
name = "multiple blocks";
expected = {
x86_64-linux = {value = "ci-packages";};
};
actual = let
testFlake = {
__ren = {
cells = ["repo"];
};
x86_64-linux = {
repo = {
ci = {packages = {value = "ci-packages";};};
other = {value = "ignored";};
};
};
};
in
rensa.select testFlake [
["repo" "ci" "packages"]
];
}
];
};
}