When calling the _completionTests_complete function in a sub-shell, the trailing newlines are removed by the shell. Therefore, if the script we are testing mistakenly includes an empty completion at the end, we would not detect that bug.
See https://github.com/spf13/cobra/pull/1691
With this commit, we use a space to separate the completions, so an empty one will be detected (extra space).
When calling the
_completionTests_complete
function in a sub-shell, the trailing newlines are removed by the shell. Therefore, if the script we are testing mistakenly includes an empty completion at the end, we would not detect that bug. See https://github.com/spf13/cobra/pull/1691With this commit, we use a space to separate the completions, so an empty one will be detected (extra space).
With this change we can see the tests failing before https://github.com/spf13/cobra/pull/1691 and start to pass again when https://github.com/spf13/cobra/pull/1691 is applied
/cc @scop