1- package probe_test
1+ package probe
22
33import (
44 "go/ast"
55 "go/token"
66 "testing"
7-
8- "github.com/mpyw/goroutinectx/internal/probe"
97)
108
119func TestFuncLitOfLiteralKey (t * testing.T ) {
@@ -29,7 +27,7 @@ func TestFuncLitOfLiteralKey(t *testing.T) {
2927 }
3028 lit := & ast.BasicLit {Kind : token .INT , Value : "1" }
3129
32- result := probe . FuncLitOfLiteralKey (compLit , lit )
30+ result := funcLitOfLiteralKey (compLit , lit )
3331 if result != fl1 {
3432 t .Errorf ("expected fl1, got %v" , result )
3533 }
@@ -44,7 +42,7 @@ func TestFuncLitOfLiteralKey(t *testing.T) {
4442 }
4543 lit := & ast.BasicLit {Kind : token .INT , Value : "0" }
4644
47- result := probe . FuncLitOfLiteralKey (compLit , lit )
45+ result := funcLitOfLiteralKey (compLit , lit )
4846 if result != fl0 {
4947 t .Errorf ("expected fl0, got %v" , result )
5048 }
@@ -58,7 +56,7 @@ func TestFuncLitOfLiteralKey(t *testing.T) {
5856 }
5957 lit := & ast.BasicLit {Kind : token .INT , Value : "-1" }
6058
61- result := probe . FuncLitOfLiteralKey (compLit , lit )
59+ result := funcLitOfLiteralKey (compLit , lit )
6260 if result != nil {
6361 t .Errorf ("expected nil for negative index, got %v" , result )
6462 }
@@ -72,7 +70,7 @@ func TestFuncLitOfLiteralKey(t *testing.T) {
7270 }
7371 lit := & ast.BasicLit {Kind : token .INT , Value : "5" }
7472
75- result := probe . FuncLitOfLiteralKey (compLit , lit )
73+ result := funcLitOfLiteralKey (compLit , lit )
7674 if result != nil {
7775 t .Errorf ("expected nil for out of range index, got %v" , result )
7876 }
@@ -86,7 +84,7 @@ func TestFuncLitOfLiteralKey(t *testing.T) {
8684 }
8785 lit := & ast.BasicLit {Kind : token .INT , Value : "abc" }
8886
89- result := probe . FuncLitOfLiteralKey (compLit , lit )
87+ result := funcLitOfLiteralKey (compLit , lit )
9088 if result != nil {
9189 t .Errorf ("expected nil for invalid int format, got %v" , result )
9290 }
@@ -100,7 +98,7 @@ func TestFuncLitOfLiteralKey(t *testing.T) {
10098 }
10199 lit := & ast.BasicLit {Kind : token .INT , Value : "0" }
102100
103- result := probe . FuncLitOfLiteralKey (compLit , lit )
101+ result := funcLitOfLiteralKey (compLit , lit )
104102 if result != nil {
105103 t .Errorf ("expected nil when element is not FuncLit, got %v" , result )
106104 }
@@ -120,7 +118,7 @@ func TestFuncLitOfLiteralKey(t *testing.T) {
120118 }
121119 lit := & ast.BasicLit {Kind : token .STRING , Value : `"mykey"` }
122120
123- result := probe . FuncLitOfLiteralKey (compLit , lit )
121+ result := funcLitOfLiteralKey (compLit , lit )
124122 if result != fl {
125123 t .Errorf ("expected fl, got %v" , result )
126124 }
@@ -139,7 +137,7 @@ func TestFuncLitOfLiteralKey(t *testing.T) {
139137 }
140138 lit := & ast.BasicLit {Kind : token .STRING , Value : `"mykey"` }
141139
142- result := probe . FuncLitOfLiteralKey (compLit , lit )
140+ result := funcLitOfLiteralKey (compLit , lit )
143141 if result != nil {
144142 t .Errorf ("expected nil when key not found, got %v" , result )
145143 }
@@ -158,7 +156,7 @@ func TestFuncLitOfLiteralKey(t *testing.T) {
158156 }
159157 lit := & ast.BasicLit {Kind : token .STRING , Value : `"mykey"` }
160158
161- result := probe . FuncLitOfLiteralKey (compLit , lit )
159+ result := funcLitOfLiteralKey (compLit , lit )
162160 if result != nil {
163161 t .Errorf ("expected nil when value is not FuncLit, got %v" , result )
164162 }
@@ -172,7 +170,7 @@ func TestFuncLitOfLiteralKey(t *testing.T) {
172170 }
173171 lit := & ast.BasicLit {Kind : token .STRING , Value : `"mykey"` }
174172
175- result := probe . FuncLitOfLiteralKey (compLit , lit )
173+ result := funcLitOfLiteralKey (compLit , lit )
176174 if result != nil {
177175 t .Errorf ("expected nil when element is not KeyValueExpr, got %v" , result )
178176 }
@@ -191,7 +189,7 @@ func TestFuncLitOfLiteralKey(t *testing.T) {
191189 }
192190 lit := & ast.BasicLit {Kind : token .STRING , Value : `"mykey"` }
193191
194- result := probe . FuncLitOfLiteralKey (compLit , lit )
192+ result := funcLitOfLiteralKey (compLit , lit )
195193 if result != nil {
196194 t .Errorf ("expected nil when key is not BasicLit, got %v" , result )
197195 }
@@ -205,7 +203,7 @@ func TestFuncLitOfLiteralKey(t *testing.T) {
205203 }
206204 lit := & ast.BasicLit {Kind : token .FLOAT , Value : "1.5" }
207205
208- result := probe . FuncLitOfLiteralKey (compLit , lit )
206+ result := funcLitOfLiteralKey (compLit , lit )
209207 if result != nil {
210208 t .Errorf ("expected nil for unsupported token kind, got %v" , result )
211209 }
0 commit comments