mirror of https://github.com/docker/cli.git
completion: add test for FromList
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
a5ca5b33f1
commit
51713196c9
|
@ -29,6 +29,14 @@ func TestCompleteFileNames(t *testing.T) {
|
||||||
assert.Check(t, is.Len(values, 0))
|
assert.Check(t, is.Len(values, 0))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestCompleteFromList(t *testing.T) {
|
||||||
|
expected := []string{"one", "two", "three"}
|
||||||
|
|
||||||
|
values, directives := FromList(expected...)(nil, nil, "")
|
||||||
|
assert.Check(t, is.Equal(directives&cobra.ShellCompDirectiveNoFileComp, cobra.ShellCompDirectiveNoFileComp), "Should not perform file completion")
|
||||||
|
assert.Check(t, is.DeepEqual(values, expected))
|
||||||
|
}
|
||||||
|
|
||||||
func TestCompletePlatforms(t *testing.T) {
|
func TestCompletePlatforms(t *testing.T) {
|
||||||
values, directives := Platforms(nil, nil, "")
|
values, directives := Platforms(nil, nil, "")
|
||||||
assert.Check(t, is.Equal(directives&cobra.ShellCompDirectiveNoFileComp, cobra.ShellCompDirectiveNoFileComp), "Should not perform file completion")
|
assert.Check(t, is.Equal(directives&cobra.ShellCompDirectiveNoFileComp, cobra.ShellCompDirectiveNoFileComp), "Should not perform file completion")
|
||||||
|
|
Loading…
Reference in New Issue