Skip to content

Commit f5a8e38

Browse files
committed
Add overlay test
1 parent 968856e commit f5a8e38

File tree

11 files changed

+451
-0
lines changed

11 files changed

+451
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package base
2+
3+
import "strings"
4+
5+
type A struct {
6+
name string
7+
}
8+
9+
/*
10+
* A block comment.
11+
* With multiple lines.
12+
*/
13+
func (a *A) GetNameLength() int {
14+
// A line comment.
15+
return len(a.name)
16+
}
17+
18+
/*
19+
* A block comment.
20+
* With multiple lines.
21+
*/
22+
func (a *A) GetNameUpper() string {
23+
// A line comment.
24+
return strings.ToUpper(a.name)
25+
}
26+
27+
func FuncA(name string) *A {
28+
return &A{name: name}
29+
}
30+
31+
func Id(name string) string {
32+
return name
33+
}
34+
35+
type B interface {
36+
GetName() string
37+
}
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
expressions
2+
| a.go:1:9:1:12 | base |
3+
| a.go:3:8:3:16 | "strings" |
4+
| a.go:5:6:5:6 | A |
5+
| a.go:5:8:7:1 | struct type |
6+
| a.go:6:2:6:5 | name |
7+
| a.go:6:7:6:12 | string |
8+
| a.go:13:1:13:31 | function type |
9+
| a.go:13:7:13:7 | a |
10+
| a.go:13:9:13:10 | star expression |
11+
| a.go:13:10:13:10 | A |
12+
| a.go:13:13:13:25 | GetNameLength |
13+
| a.go:13:29:13:31 | int |
14+
| a.go:15:9:15:11 | len |
15+
| a.go:15:9:15:19 | call to len |
16+
| a.go:15:13:15:13 | a |
17+
| a.go:15:13:15:18 | selection of name |
18+
| a.go:15:15:15:18 | name |
19+
| a.go:22:1:22:33 | function type |
20+
| a.go:22:7:22:7 | a |
21+
| a.go:22:9:22:10 | star expression |
22+
| a.go:22:10:22:10 | A |
23+
| a.go:22:13:22:24 | GetNameUpper |
24+
| a.go:22:28:22:33 | string |
25+
| a.go:24:9:24:15 | strings |
26+
| a.go:24:9:24:23 | selection of ToUpper |
27+
| a.go:24:9:24:31 | call to ToUpper |
28+
| a.go:24:17:24:23 | ToUpper |
29+
| a.go:24:25:24:25 | a |
30+
| a.go:24:25:24:30 | selection of name |
31+
| a.go:24:27:24:30 | name |
32+
| a.go:27:1:27:26 | function type |
33+
| a.go:27:6:27:10 | FuncA |
34+
| a.go:27:12:27:15 | name |
35+
| a.go:27:17:27:22 | string |
36+
| a.go:27:25:27:26 | star expression |
37+
| a.go:27:26:27:26 | A |
38+
| a.go:28:9:28:22 | &... |
39+
| a.go:28:10:28:10 | A |
40+
| a.go:28:10:28:22 | struct literal |
41+
| a.go:28:12:28:15 | name |
42+
| a.go:28:12:28:21 | key-value pair |
43+
| a.go:28:18:28:21 | name |
44+
| a.go:31:1:31:27 | function type |
45+
| a.go:31:6:31:7 | Id |
46+
| a.go:31:9:31:12 | name |
47+
| a.go:31:14:31:19 | string |
48+
| a.go:31:22:31:27 | string |
49+
| a.go:32:9:32:12 | name |
50+
| a.go:35:6:35:6 | B |
51+
| a.go:35:8:37:1 | interface type |
52+
| a.go:36:2:36:8 | GetName |
53+
| a.go:36:9:36:17 | function type |
54+
| a.go:36:12:36:17 | string |
55+
statements
56+
| a.go:13:33:16:1 | block statement |
57+
| a.go:15:2:15:19 | return statement |
58+
| a.go:22:35:25:1 | block statement |
59+
| a.go:24:2:24:31 | return statement |
60+
| a.go:27:28:29:1 | block statement |
61+
| a.go:28:2:28:22 | return statement |
62+
| a.go:31:29:33:1 | block statement |
63+
| a.go:32:2:32:12 | return statement |
64+
functions
65+
| a.go:13:13:13:25 | GetNameLength |
66+
| a.go:22:13:22:24 | GetNameUpper |
67+
| a.go:27:6:27:10 | FuncA |
68+
| a.go:31:6:31:7 | Id |
69+
| a.go:36:2:36:8 | GetName |
70+
types
71+
| a.go:5:6:5:6 | A |
72+
| a.go:35:6:35:6 | B |
73+
parameters
74+
| a.go:13:7:13:7 | a |
75+
| a.go:22:7:22:7 | a |
76+
| a.go:27:12:27:15 | name |
77+
| a.go:31:9:31:12 | name |
78+
fields
79+
| a.go:6:2:6:5 | name |
80+
commentLines
81+
| a.go:9:1:12:3 | comment |
82+
| a.go:14:2:14:19 | comment |
83+
| a.go:18:1:21:3 | comment |
84+
| a.go:23:2:23:19 | comment |
85+
commentBlocks
86+
| a.go:9:1:12:3 | comment group |
87+
| a.go:14:2:14:19 | comment group |
88+
| a.go:18:1:21:3 | comment group |
89+
| a.go:23:2:23:19 | comment group |
90+
htmlElements
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
query: ../test.ql
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
overlay:
2+
base: "base/"
3+
overlay: "overlay/"
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package base
2+
3+
import "strings"
4+
5+
type C struct{}
6+
7+
type A struct {
8+
name string
9+
}
10+
11+
func (a *A) GetNameUpper() string {
12+
return strings.ToUpper(a.name)
13+
}
14+
15+
/*
16+
* A block comment.
17+
* With multiple lines.
18+
*/
19+
func (a *A) GetName() string {
20+
// A line comment.
21+
return a.name
22+
}
23+
24+
func Id(name string) string {
25+
return name
26+
}
27+
28+
/*
29+
* A block comment.
30+
* With multiple lines.
31+
*/
32+
func FuncC() *C {
33+
// A line comment.
34+
return &C{}
35+
}
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
expressions
2+
| a.go:1:9:1:12 | base |
3+
| a.go:3:8:3:16 | "strings" |
4+
| a.go:5:6:5:6 | C |
5+
| a.go:5:8:5:15 | struct type |
6+
| a.go:7:6:7:6 | A |
7+
| a.go:7:8:9:1 | struct type |
8+
| a.go:8:2:8:5 | name |
9+
| a.go:8:7:8:12 | string |
10+
| a.go:11:1:11:33 | function type |
11+
| a.go:11:7:11:7 | a |
12+
| a.go:11:9:11:10 | star expression |
13+
| a.go:11:10:11:10 | A |
14+
| a.go:11:13:11:24 | GetNameUpper |
15+
| a.go:11:28:11:33 | string |
16+
| a.go:12:9:12:15 | strings |
17+
| a.go:12:9:12:23 | selection of ToUpper |
18+
| a.go:12:9:12:31 | call to ToUpper |
19+
| a.go:12:17:12:23 | ToUpper |
20+
| a.go:12:25:12:25 | a |
21+
| a.go:12:25:12:30 | selection of name |
22+
| a.go:12:27:12:30 | name |
23+
| a.go:19:1:19:28 | function type |
24+
| a.go:19:7:19:7 | a |
25+
| a.go:19:9:19:10 | star expression |
26+
| a.go:19:10:19:10 | A |
27+
| a.go:19:13:19:19 | GetName |
28+
| a.go:19:23:19:28 | string |
29+
| a.go:21:9:21:9 | a |
30+
| a.go:21:9:21:14 | selection of name |
31+
| a.go:21:11:21:14 | name |
32+
| a.go:24:1:24:27 | function type |
33+
| a.go:24:6:24:7 | Id |
34+
| a.go:24:9:24:12 | name |
35+
| a.go:24:14:24:19 | string |
36+
| a.go:24:22:24:27 | string |
37+
| a.go:25:9:25:12 | name |
38+
| a.go:32:1:32:15 | function type |
39+
| a.go:32:6:32:10 | FuncC |
40+
| a.go:32:14:32:15 | star expression |
41+
| a.go:32:15:32:15 | C |
42+
| a.go:34:9:34:12 | &... |
43+
| a.go:34:10:34:10 | C |
44+
| a.go:34:10:34:12 | struct literal |
45+
statements
46+
| a.go:11:35:13:1 | block statement |
47+
| a.go:12:2:12:31 | return statement |
48+
| a.go:19:30:22:1 | block statement |
49+
| a.go:21:2:21:14 | return statement |
50+
| a.go:24:29:26:1 | block statement |
51+
| a.go:25:2:25:12 | return statement |
52+
| a.go:32:17:35:1 | block statement |
53+
| a.go:34:2:34:12 | return statement |
54+
functions
55+
| a.go:11:13:11:24 | GetNameUpper |
56+
| a.go:19:13:19:19 | GetName |
57+
| a.go:24:6:24:7 | Id |
58+
| a.go:32:6:32:10 | FuncC |
59+
types
60+
| a.go:5:6:5:6 | C |
61+
| a.go:7:6:7:6 | A |
62+
parameters
63+
| a.go:11:7:11:7 | a |
64+
| a.go:19:7:19:7 | a |
65+
| a.go:24:9:24:12 | name |
66+
fields
67+
| a.go:8:2:8:5 | name |
68+
commentLines
69+
| a.go:15:1:18:3 | comment |
70+
| a.go:20:2:20:19 | comment |
71+
| a.go:28:1:31:3 | comment |
72+
| a.go:33:2:33:19 | comment |
73+
commentBlocks
74+
| a.go:15:1:18:3 | comment group |
75+
| a.go:20:2:20:19 | comment group |
76+
| a.go:28:1:31:3 | comment group |
77+
| a.go:33:2:33:19 | comment group |
78+
htmlElements
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
query: ../test.ql

0 commit comments

Comments
 (0)