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:
@@ -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[@]} ]
|
||||||
|
|||||||
Reference in New Issue
Block a user