diff --git a/tests/functional/flakes/show.sh b/tests/functional/flakes/show.sh index 0edc450c345d..c7eb7f0b5cb9 100755 --- a/tests/functional/flakes/show.sh +++ b/tests/functional/flakes/show.sh @@ -106,9 +106,17 @@ cat >flake.nix< ./show-output.txt +# close stderr, to force consistent tty size across different environments +nix flake show > ./show-output.txt 2>/dev/null +cat show-output.txt >&2 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' - '012345678901234567890123456..." -test "$(awk -F '[:] ' '/eEmptyDescription/{print $NF}' ./show-output.txt)" = "package 'simple'" \ No newline at end of file +dLongDescription=$(awk -F '[:] ' '/dLongDescription/{print $NF}' ./show-output.txt) +if [[ $dLongDescription == "package 'simple' - '0123456789"* ]]; then + : +else + echo "description not as expected: $dLongDescription" + false +fi +test "$(awk -F '[:] ' '/eEmptyDescription/{print $NF}' ./show-output.txt)" = "package 'simple'"