@@ -23,8 +23,7 @@ type queryCallGraphTestCase struct {
2323 clientId string
2424 codebasePath string
2525 filePath string
26- startLine int
27- endLine int
26+ lineRange string
2827 symbolName string
2928 maxLayer int
3029 expectedStatus int
@@ -40,8 +39,7 @@ func (s *QueryCallGraphIntegrationTestSuite) TestQueryCallGraph() {
4039 clientId : "123" ,
4140 codebasePath : s .workspacePath ,
4241 filePath : filepath .Join (s .workspacePath , "test" , "api" , "query_reference_test.go" ),
43- startLine : 1 ,
44- endLine : 1000 ,
42+ lineRange : "1-1000" ,
4543 symbolName : "" ,
4644 maxLayer : 3 ,
4745 expectedStatus : http .StatusOK ,
@@ -60,7 +58,6 @@ func (s *QueryCallGraphIntegrationTestSuite) TestQueryCallGraph() {
6058 assert .Contains (t , firstItem , "filePath" )
6159 assert .Contains (t , firstItem , "symbolName" )
6260 assert .Contains (t , firstItem , "position" )
63- assert .Contains (t , firstItem , "content" )
6461 assert .Contains (t , firstItem , "nodeType" )
6562
6663 position := firstItem ["position" ].(map [string ]interface {})
@@ -87,8 +84,7 @@ func (s *QueryCallGraphIntegrationTestSuite) TestQueryCallGraph() {
8784 clientId : "123" ,
8885 codebasePath : s .workspacePath ,
8986 filePath : filepath .Join (s .workspacePath , "test" , "api" , "query_reference_test.go" ),
90- startLine : 1 ,
91- endLine : 1000 ,
87+ lineRange : "" ,
9288 symbolName : "TestQueryReference" ,
9389 maxLayer : 2 ,
9490 expectedStatus : http .StatusOK ,
@@ -106,8 +102,7 @@ func (s *QueryCallGraphIntegrationTestSuite) TestQueryCallGraph() {
106102 name : "缺少codebasePath参数" ,
107103 clientId : "123" ,
108104 filePath : filepath .Join (s .workspacePath , "test" , "api" , "query_reference_test.go" ),
109- startLine : 1 ,
110- endLine : 1000 ,
105+ lineRange : "1-1000" ,
111106 symbolName : "" ,
112107 maxLayer : 3 ,
113108 expectedStatus : http .StatusBadRequest ,
@@ -119,8 +114,7 @@ func (s *QueryCallGraphIntegrationTestSuite) TestQueryCallGraph() {
119114 name : "缺少filePath参数" ,
120115 clientId : "123" ,
121116 codebasePath : s .workspacePath ,
122- startLine : 1 ,
123- endLine : 1000 ,
117+ lineRange : "1-1000" ,
124118 symbolName : "" ,
125119 maxLayer : 3 ,
126120 expectedStatus : http .StatusBadRequest ,
@@ -133,8 +127,7 @@ func (s *QueryCallGraphIntegrationTestSuite) TestQueryCallGraph() {
133127 clientId : "123" ,
134128 codebasePath : s .workspacePath ,
135129 filePath : filepath .Join (s .workspacePath , "test" , "api" , "no_exists.go" ),
136- startLine : 1 ,
137- endLine : 1000 ,
130+ lineRange : "1-1000" ,
138131 symbolName : "" ,
139132 maxLayer : 3 ,
140133 expectedStatus : http .StatusBadRequest ,
@@ -148,8 +141,7 @@ func (s *QueryCallGraphIntegrationTestSuite) TestQueryCallGraph() {
148141 clientId : "" ,
149142 codebasePath : "" ,
150143 filePath : "" ,
151- startLine : 0 ,
152- endLine : 0 ,
144+ lineRange : "" ,
153145 symbolName : "" ,
154146 maxLayer : 0 ,
155147 expectedStatus : http .StatusBadRequest ,
@@ -162,8 +154,7 @@ func (s *QueryCallGraphIntegrationTestSuite) TestQueryCallGraph() {
162154 clientId : "123" ,
163155 codebasePath : s .workspacePath ,
164156 filePath : filepath .Join (s .workspacePath , "test" , "api" , "query_reference_test.go" ),
165- startLine : 1 ,
166- endLine : 1000 ,
157+ lineRange : "1-1000" ,
167158 symbolName : "" ,
168159 maxLayer : 10 , // 测试最大层数
169160 expectedStatus : http .StatusOK ,
@@ -182,8 +173,7 @@ func (s *QueryCallGraphIntegrationTestSuite) TestQueryCallGraph() {
182173 clientId : "123" ,
183174 codebasePath : s .workspacePath ,
184175 filePath : filepath .Join (s .workspacePath , "test" , "api" , "query_reference_test.go" ),
185- startLine : 30 ,
186- endLine : 50 ,
176+ lineRange : "30-50" ,
187177 symbolName : "" ,
188178 maxLayer : 2 ,
189179 expectedStatus : http .StatusOK ,
@@ -217,11 +207,8 @@ func (s *QueryCallGraphIntegrationTestSuite) TestQueryCallGraph() {
217207 if tc .filePath != "" {
218208 q .Add ("filePath" , tc .filePath )
219209 }
220- if tc .startLine > 0 {
221- q .Add ("startLine" , fmt .Sprintf ("%d" , tc .startLine ))
222- }
223- if tc .endLine > 0 {
224- q .Add ("endLine" , fmt .Sprintf ("%d" , tc .endLine ))
210+ if tc .lineRange != "" {
211+ q .Add ("lineRange" , tc .lineRange )
225212 }
226213 if tc .symbolName != "" {
227214 q .Add ("symbolName" , tc .symbolName )
0 commit comments