未验证 提交 da4bd44b 编写于 作者: P Phodal Huang

refactor: extract vars

上级 63cbe159
......@@ -28,6 +28,11 @@ func TestJavaCallListener_EnterConstructorDeclaration(t *testing.T) {
g := NewGomegaWithT(t)
codePath := "../../../_fixtures/suggest/factory"
callNodes := getCallNodes(codePath)
g.Expect(len(callNodes[0].Methods)).To(Equal(3))
}
func getCallNodes(codePath string) []models.JClassNode {
identifierApp := new(identifier.JavaIdentifierApp)
iNodes := identifierApp.AnalysisPath(codePath)
var classes []string = nil
......@@ -38,23 +43,14 @@ func TestJavaCallListener_EnterConstructorDeclaration(t *testing.T) {
callApp := NewJavaCallApp()
callNodes := callApp.AnalysisPath(codePath, classes, iNodes)
g.Expect(len(callNodes[0].Methods)).To(Equal(3))
return callNodes
}
func TestLambda_Express(t *testing.T) {
g := NewGomegaWithT(t)
codePath := "../../../_fixtures/lambda"
identifierApp := new(identifier.JavaIdentifierApp)
iNodes := identifierApp.AnalysisPath(codePath)
var classes []string = nil
for _, node := range iNodes {
classes = append(classes, node.Package+"."+node.ClassName)
}
callApp := NewJavaCallApp()
callNodes := callApp.AnalysisPath(codePath, classes, iNodes)
callNodes := getCallNodes(codePath)
methodMap := make(map[string]models.JMethod)
for _, c := range callNodes[1].Methods {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册