mirror of
https://gitlab.com/rensa-nix/core.git
synced 2026-02-02 07:15:08 +01:00
chore: add nixtest for testing and a couple of tests
This commit is contained in:
parent
e08c48b5db
commit
e6c13290bb
8 changed files with 281 additions and 0 deletions
49
tests/select_test.nix
Normal file
49
tests/select_test.nix
Normal 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"]
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue