Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kjeremy committed Jul 8, 2024
1 parent 496e6d5 commit fdafe03
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/functional/flakes/show.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,23 @@ assert show_output.legacyPackages.${builtins.currentSystem}.AAAAAASomeThingsFail
assert show_output.legacyPackages.${builtins.currentSystem}.simple.name == "simple";
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 > a.txt
cat a.txt
test "$(awk -F '[:] ' '/aNoDescription/{print $NF}' a.txt)" = "package 'simple'"
test "$(awk -F '[:] ' '/bOneLineDescription/{print $NF}' a.txt)" = "package 'simple' - 'one line'"
test "$(awk -F '[:] ' '/cMultiLineDescription/{print $NF}' a.txt)" = "package 'simple' - 'line one'"

0 comments on commit fdafe03

Please sign in to comment.