本文整理汇总了Golang中github.com/quarnster/completion/content.CompleteAtArgs.SessionId方法的典型用法代码示例。如果您正苦于以下问题:Golang CompleteAtArgs.SessionId方法的具体用法?Golang CompleteAtArgs.SessionId怎么用?Golang CompleteAtArgs.SessionId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/quarnster/completion/content.CompleteAtArgs
的用法示例。
在下文中一共展示了CompleteAtArgs.SessionId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: TestNet
func TestNet(t *testing.T) {
paths := DefaultPaths()
if len(paths) == 0 {
t.Skip("Neither mono nor Windows .NET Framework paths were possible to get")
}
var (
n Net
args content.CompleteAtArgs
cmp content.CompletionResult
)
tests := []struct {
InFile string
Line, Column uint
}{
// TODO: this test is not platform independent as it depends on whatever framework you happen
// to have installed
{"./testdata/CompleteSharp.cs", 40, 27},
{"./testdata/CompleteSharp.cs", 40, 41},
{"./testdata/CompleteSharp.cs", 47, 47},
//{"./testdata/CompleteSharp.cs", 28, 14},
{"./testdata/CompleteSharp.cs", 211, 46},
{"./testdata/CompleteSharp.cs", 761, 83},
{"./testdata/CompleteSharp.cs", 761, 27},
{"./testdata/CompleteSharp.cs", 857, 29},
{"./testdata/CompleteSharp.cs", 737, 15},
{"./testdata/CompleteSharp.cs", 95, 38},
{"./testdata/CompleteSharp.cs", 95, 45},
{"./testdata/CompleteSharp.cs", 776, 39},
{"./testdata/NamespaceTest.cs", 4, 15},
{"./testdata/NamespaceTest.cs", 6, 15},
}
args.SessionId = "a"
args.Settings().Set("net_paths", []string{"./testdata/"})
args.Settings().Set("net_assemblies", []string{"CompleteSharp.exe"})
for _, test := range tests {
args.Location.File.Name = test.InFile
args.Location.Line = test.Line
args.Location.Column = test.Column
ex := fmt.Sprintf("%s-%d-%d.cmp", test.InFile, test.Line, test.Column)
if err := n.CompleteAt(&args, &cmp); err != nil {
t.Errorf("Unable to complete %v: %s", test, err)
} else if exp, err := ioutil.ReadFile(ex); err != nil {
t.Logf("Couldn't read the expected output file %s (%s); it'll be created", ex, err)
if err := ioutil.WriteFile(ex, []byte(cmp.String()), 0644); err != nil {
t.Error(err)
}
} else if d := util.Diff(string(exp), cmp.String()); len(d) != 0 {
t.Error(d)
}
}
}