Skip to content

Conversation

marckhouzam
Copy link
Owner

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 spf13/cobra#1691

With 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 spf13/cobra#1691 and start to pass again when spf13/cobra#1691 is applied

/cc @scop

When calling the _completionTests_complete function in a subshell,
the trailing newlines are removed by the shell.  Therefore if the script
mistakenly includes an empty completion at the end, we would not detect
that bug.  See spf13/cobra#1691

With this commit, we use a space to separate the completions, so an
empty one will be detected (extra space).

Signed-off-by: Marc Khouzam <marc.khouzam@gmail.com>
@marckhouzam marckhouzam merged commit af718ac into main May 17, 2022
@marckhouzam marckhouzam deleted the feat/detectNewLine branch May 17, 2022 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant