github.com/oweisse/u-root@v0.0.0-20181109060735-d005ad25fef1/cmds/elvish/edit/completion/complete_arg_test.go (about)

     1  package completion
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/u-root/u-root/cmds/elvish/parse"
     7  )
     8  
     9  func TestFindArgComplContext(t *testing.T) {
    10  	testComplContextFinder(t, "findArgComplContext", findArgComplContext, []complContextFinderTest{
    11  		{"a ", &argComplContext{
    12  			complContextCommon{"", quotingForEmptySeed, 2, 2}, []string{"a", ""}}},
    13  		{"a b", &argComplContext{
    14  			complContextCommon{"b", parse.Bareword, 2, 3}, []string{"a", "b"}}},
    15  		// No space after command; won't complete arg
    16  		{"a", nil},
    17  	})
    18  }