test-lib: Avoid empty line in diff when no completion.

There should be a trailing newline when there are completions (to avoid diff complaining about "no trailing newline", but not when there are no completions at all.
This commit is contained in:
Ingo Karkat
2012-02-22 08:43:47 +01:00
parent 451dbdda6b
commit c9d1993dc8

View File

@@ -660,8 +660,8 @@ test_todo_completion () {
_todo _todo
IFS=$'\n' IFS=$'\n'
printf '%s\n' "${EXPECT[*]}" > expect printf "%s${EXPECT:+\\n}" "${EXPECT[*]}" > expect
printf '%s\n' "${COMPREPLY[*]}" > output printf "%s${COMPREPLY:+\\n}" "${COMPREPLY[*]}" > output
IFS=$SAVEIFS IFS=$SAVEIFS
if [ ${#COMPREPLY[@]} -eq ${#EXPECT[@]} ] if [ ${#COMPREPLY[@]} -eq ${#EXPECT[@]} ]