mirror of
https://github.com/NixOS/nix.git
synced 2024-11-25 08:12:29 +00:00
add tests
This commit is contained in:
parent
07d0527c0c
commit
59b6aafadb
@ -87,3 +87,22 @@ assert show_output.legacyPackages.${builtins.currentSystem}.AAAAAASomeThingsFail
|
|||||||
assert show_output.legacyPackages.${builtins.currentSystem}.simple.name == "simple";
|
assert show_output.legacyPackages.${builtins.currentSystem}.simple.name == "simple";
|
||||||
true
|
true
|
||||||
'
|
'
|
||||||
|
|
||||||
|
cat >flake.nix<<EOF
|
||||||
|
{
|
||||||
|
outputs = inputs: {
|
||||||
|
packages.$system = {
|
||||||
|
aNoDescription = import ./simple.nix;
|
||||||
|
bOneLineDescription = import ./simple.nix // { meta.description = "one line"; };
|
||||||
|
cMultiLineDescription = import ./simple.nix // { meta.description = ''
|
||||||
|
line one
|
||||||
|
line two
|
||||||
|
''; };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
nix flake show > ./show-output.txt
|
||||||
|
test "$(awk -F '[:] ' '/aNoDescription/{print $NF}' ./show-output.txt)" = "package 'simple'"
|
||||||
|
test "$(awk -F '[:] ' '/bOneLineDescription/{print $NF}' ./show-output.txt)" = "package 'simple' - 'one line'"
|
||||||
|
test "$(awk -F '[:] ' '/cMultiLineDescription/{print $NF}' ./show-output.txt)" = "package 'simple' - 'line one'"
|
||||||
|
Loading…
Reference in New Issue
Block a user