aboutsummaryrefslogtreecommitdiff
path: root/tests/functional/flakes/show.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/functional/flakes/show.sh')
-rw-r--r--tests/functional/flakes/show.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/functional/flakes/show.sh b/tests/functional/flakes/show.sh
index a3d300552..25f481575 100644
--- a/tests/functional/flakes/show.sh
+++ b/tests/functional/flakes/show.sh
@@ -85,3 +85,31 @@ 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
+ ''; };
+ dLongDescription = import ./simple.nix // { meta.description = ''
+ abcdefghijklmnopqrstuvwxyz
+ ''; };
+ eEmptyDescription = import ./simple.nix // { meta.description = ""; };
+ };
+ };
+}
+EOF
+unbuffer sh -c '
+ stty rows 20 cols 100
+ 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'"
+test "$(awk -F '[:] ' '/dLongDescription/{print $NF}' ./show-output.txt)" = "package 'simple' - 'abcdefghijklmnopqrs...'"
+test "$(awk -F '[:] ' '/eEmptyDescription/{print $NF}' ./show-output.txt)" = "package 'simple'"