mirror of
https://github.com/github/semantic.git
synced 2024-12-24 23:42:31 +03:00
3075 lines
99 KiB
JSON
3075 lines
99 KiB
JSON
[{
|
|
"testCaseDescription": "go-function-declarations-insert-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"function-declarations.go": [
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
1,
|
|
13
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'f1' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
2,
|
|
6
|
|
],
|
|
"end": [
|
|
2,
|
|
8
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'f2' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
2,
|
|
9
|
|
],
|
|
"end": [
|
|
2,
|
|
10
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'a' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
2,
|
|
11
|
|
],
|
|
"end": [
|
|
2,
|
|
14
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'int' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
2,
|
|
16
|
|
],
|
|
"end": [
|
|
2,
|
|
17
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'b' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
2,
|
|
19
|
|
],
|
|
"end": [
|
|
2,
|
|
20
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'c' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
2,
|
|
22
|
|
],
|
|
"end": [
|
|
2,
|
|
23
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'd' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
2,
|
|
24
|
|
],
|
|
"end": [
|
|
2,
|
|
30
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'string' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
2,
|
|
32
|
|
],
|
|
"end": [
|
|
2,
|
|
35
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'int' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
2,
|
|
36
|
|
],
|
|
"end": [
|
|
2,
|
|
38
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the '{}' block"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
3,
|
|
6
|
|
],
|
|
"end": [
|
|
3,
|
|
8
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'f2' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
3,
|
|
8
|
|
],
|
|
"end": [
|
|
3,
|
|
10
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the '()' arguments"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
3,
|
|
12
|
|
],
|
|
"end": [
|
|
3,
|
|
15
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'int' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
3,
|
|
17
|
|
],
|
|
"end": [
|
|
3,
|
|
22
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'error' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
3,
|
|
24
|
|
],
|
|
"end": [
|
|
3,
|
|
26
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the '{}' block"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
4,
|
|
6
|
|
],
|
|
"end": [
|
|
4,
|
|
8
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'f2' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
4,
|
|
8
|
|
],
|
|
"end": [
|
|
4,
|
|
10
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the '()' arguments"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
4,
|
|
12
|
|
],
|
|
"end": [
|
|
4,
|
|
18
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'result' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
4,
|
|
19
|
|
],
|
|
"end": [
|
|
4,
|
|
22
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'int' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
4,
|
|
24
|
|
],
|
|
"end": [
|
|
4,
|
|
27
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'err' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
4,
|
|
28
|
|
],
|
|
"end": [
|
|
4,
|
|
33
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'error' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
4,
|
|
35
|
|
],
|
|
"end": [
|
|
4,
|
|
37
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the '{}' block"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"function-declarations.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/function-declarations.go b/function-declarations.go",
|
|
"index e69de29..21da2ea 100644",
|
|
"--- a/function-declarations.go",
|
|
"+++ b/function-declarations.go",
|
|
"@@ -0,0 +1,4 @@",
|
|
"+func f1() {}",
|
|
"+func f2(a int, b, c, d string) int {}",
|
|
"+func f2() (int, error) {}",
|
|
"+func f2() (result int, err error) {}"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "3d03e853fe314968652aa9f726a58b23b5178fb9..c3e2a635d32a6ac0bdb9e4db375774073206d7a1"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-function-declarations-replacement-insert-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"function-declarations.go": [
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
1,
|
|
13
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'fa' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
2,
|
|
6
|
|
],
|
|
"end": [
|
|
2,
|
|
8
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'fb' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
2,
|
|
9
|
|
],
|
|
"end": [
|
|
2,
|
|
10
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'a' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
2,
|
|
11
|
|
],
|
|
"end": [
|
|
2,
|
|
14
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'int' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
2,
|
|
16
|
|
],
|
|
"end": [
|
|
2,
|
|
17
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'b' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
2,
|
|
19
|
|
],
|
|
"end": [
|
|
2,
|
|
20
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'c' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
2,
|
|
22
|
|
],
|
|
"end": [
|
|
2,
|
|
23
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'd' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
2,
|
|
24
|
|
],
|
|
"end": [
|
|
2,
|
|
30
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'string' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
2,
|
|
32
|
|
],
|
|
"end": [
|
|
2,
|
|
35
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'int' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
2,
|
|
36
|
|
],
|
|
"end": [
|
|
2,
|
|
38
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the '{}' block"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
3,
|
|
6
|
|
],
|
|
"end": [
|
|
3,
|
|
8
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'fc' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
3,
|
|
8
|
|
],
|
|
"end": [
|
|
3,
|
|
10
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the '()' arguments"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
3,
|
|
12
|
|
],
|
|
"end": [
|
|
3,
|
|
15
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'int' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
3,
|
|
17
|
|
],
|
|
"end": [
|
|
3,
|
|
22
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'error' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
3,
|
|
24
|
|
],
|
|
"end": [
|
|
3,
|
|
26
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the '{}' block"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
4,
|
|
6
|
|
],
|
|
"end": [
|
|
4,
|
|
8
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'fd' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
4,
|
|
8
|
|
],
|
|
"end": [
|
|
4,
|
|
10
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the '()' arguments"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
4,
|
|
12
|
|
],
|
|
"end": [
|
|
4,
|
|
18
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'result' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
4,
|
|
19
|
|
],
|
|
"end": [
|
|
4,
|
|
22
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'int' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
4,
|
|
24
|
|
],
|
|
"end": [
|
|
4,
|
|
27
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'err' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
4,
|
|
28
|
|
],
|
|
"end": [
|
|
4,
|
|
33
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'error' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
4,
|
|
35
|
|
],
|
|
"end": [
|
|
4,
|
|
37
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the '{}' block"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
5,
|
|
1
|
|
],
|
|
"end": [
|
|
5,
|
|
13
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'f1' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
6,
|
|
6
|
|
],
|
|
"end": [
|
|
6,
|
|
8
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'f2' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
6,
|
|
9
|
|
],
|
|
"end": [
|
|
6,
|
|
10
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'a' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
6,
|
|
11
|
|
],
|
|
"end": [
|
|
6,
|
|
14
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'int' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
6,
|
|
16
|
|
],
|
|
"end": [
|
|
6,
|
|
17
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'b' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
6,
|
|
19
|
|
],
|
|
"end": [
|
|
6,
|
|
20
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'c' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
6,
|
|
22
|
|
],
|
|
"end": [
|
|
6,
|
|
23
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'd' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
6,
|
|
24
|
|
],
|
|
"end": [
|
|
6,
|
|
30
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'string' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
6,
|
|
32
|
|
],
|
|
"end": [
|
|
6,
|
|
35
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'int' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
6,
|
|
36
|
|
],
|
|
"end": [
|
|
6,
|
|
38
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the '{}' block"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
7,
|
|
6
|
|
],
|
|
"end": [
|
|
7,
|
|
8
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'f2' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
7,
|
|
8
|
|
],
|
|
"end": [
|
|
7,
|
|
10
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the '()' arguments"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
7,
|
|
12
|
|
],
|
|
"end": [
|
|
7,
|
|
15
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'int' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
7,
|
|
17
|
|
],
|
|
"end": [
|
|
7,
|
|
22
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'error' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
7,
|
|
24
|
|
],
|
|
"end": [
|
|
7,
|
|
26
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the '{}' block"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
8,
|
|
6
|
|
],
|
|
"end": [
|
|
8,
|
|
8
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'f2' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
8,
|
|
8
|
|
],
|
|
"end": [
|
|
8,
|
|
10
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the '()' arguments"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
8,
|
|
12
|
|
],
|
|
"end": [
|
|
8,
|
|
18
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'result' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
8,
|
|
19
|
|
],
|
|
"end": [
|
|
8,
|
|
22
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'int' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
8,
|
|
24
|
|
],
|
|
"end": [
|
|
8,
|
|
27
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'err' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
8,
|
|
28
|
|
],
|
|
"end": [
|
|
8,
|
|
33
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'error' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
8,
|
|
35
|
|
],
|
|
"end": [
|
|
8,
|
|
37
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the '{}' block"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"function-declarations.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/function-declarations.go b/function-declarations.go",
|
|
"index 21da2ea..768679a 100644",
|
|
"--- a/function-declarations.go",
|
|
"+++ b/function-declarations.go",
|
|
"@@ -1,3 +1,11 @@",
|
|
"+func fa() {}",
|
|
"+func fb(a int, b, c, d string) int {}",
|
|
"+func fc() (int, error) {}",
|
|
"+func fd() (result int, err error) {}",
|
|
"+func f1() {}",
|
|
"+func f2(a int, b, c, d string) int {}",
|
|
"+func f2() (int, error) {}",
|
|
"+func f2() (result int, err error) {}",
|
|
" func f1() {}",
|
|
" func f2(a int, b, c, d string) int {}",
|
|
" func f2() (int, error) {}"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "c3e2a635d32a6ac0bdb9e4db375774073206d7a1..a4b3226aff4584cff12a13aea57865c07dcb937b"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-function-declarations-delete-insert-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"function-declarations.go": [
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
1,
|
|
6
|
|
],
|
|
"end": [
|
|
1,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
1,
|
|
6
|
|
],
|
|
"end": [
|
|
1,
|
|
8
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'fa' identifier with the 'f1' identifier in the f1 function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
2,
|
|
6
|
|
],
|
|
"end": [
|
|
2,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
2,
|
|
6
|
|
],
|
|
"end": [
|
|
2,
|
|
8
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'fb' identifier with the 'f2' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
3,
|
|
6
|
|
],
|
|
"end": [
|
|
3,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
3,
|
|
6
|
|
],
|
|
"end": [
|
|
3,
|
|
8
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'fc' identifier with the 'f2' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
4,
|
|
6
|
|
],
|
|
"end": [
|
|
4,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
4,
|
|
6
|
|
],
|
|
"end": [
|
|
4,
|
|
8
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'fd' identifier with the 'f2' identifier"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"function-declarations.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/function-declarations.go b/function-declarations.go",
|
|
"index 768679a..da899b5 100644",
|
|
"--- a/function-declarations.go",
|
|
"+++ b/function-declarations.go",
|
|
"@@ -1,7 +1,7 @@",
|
|
"-func fa() {}",
|
|
"-func fb(a int, b, c, d string) int {}",
|
|
"-func fc() (int, error) {}",
|
|
"-func fd() (result int, err error) {}",
|
|
"+func f1() {}",
|
|
"+func f2(a int, b, c, d string) int {}",
|
|
"+func f2() (int, error) {}",
|
|
"+func f2() (result int, err error) {}",
|
|
" func f1() {}",
|
|
" func f2(a int, b, c, d string) int {}",
|
|
" func f2() (int, error) {}"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "a4b3226aff4584cff12a13aea57865c07dcb937b..679c5b2f2c6a131801277e35c3a0756ad27476a4"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-function-declarations-replacement-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"function-declarations.go": [
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
1,
|
|
6
|
|
],
|
|
"end": [
|
|
1,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
1,
|
|
6
|
|
],
|
|
"end": [
|
|
1,
|
|
8
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'f1' identifier with the 'fa' identifier in the fa function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
2,
|
|
6
|
|
],
|
|
"end": [
|
|
2,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
2,
|
|
6
|
|
],
|
|
"end": [
|
|
2,
|
|
8
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'f2' identifier with the 'fb' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
3,
|
|
6
|
|
],
|
|
"end": [
|
|
3,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
3,
|
|
6
|
|
],
|
|
"end": [
|
|
3,
|
|
8
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'f2' identifier with the 'fc' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
4,
|
|
6
|
|
],
|
|
"end": [
|
|
4,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
4,
|
|
6
|
|
],
|
|
"end": [
|
|
4,
|
|
8
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'f2' identifier with the 'fd' identifier"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"function-declarations.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/function-declarations.go b/function-declarations.go",
|
|
"index da899b5..768679a 100644",
|
|
"--- a/function-declarations.go",
|
|
"+++ b/function-declarations.go",
|
|
"@@ -1,7 +1,7 @@",
|
|
"-func f1() {}",
|
|
"-func f2(a int, b, c, d string) int {}",
|
|
"-func f2() (int, error) {}",
|
|
"-func f2() (result int, err error) {}",
|
|
"+func fa() {}",
|
|
"+func fb(a int, b, c, d string) int {}",
|
|
"+func fc() (int, error) {}",
|
|
"+func fd() (result int, err error) {}",
|
|
" func f1() {}",
|
|
" func f2(a int, b, c, d string) int {}",
|
|
" func f2() (int, error) {}"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "679c5b2f2c6a131801277e35c3a0756ad27476a4..6865d4d27ce65230e7fc3fbc6f51601246198248"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-function-declarations-delete-replacement-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"function-declarations.go": [
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
1,
|
|
13
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'fa' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
2,
|
|
6
|
|
],
|
|
"end": [
|
|
2,
|
|
8
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'fb' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
2,
|
|
9
|
|
],
|
|
"end": [
|
|
2,
|
|
10
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'a' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
2,
|
|
11
|
|
],
|
|
"end": [
|
|
2,
|
|
14
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'int' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
2,
|
|
16
|
|
],
|
|
"end": [
|
|
2,
|
|
17
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'b' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
2,
|
|
19
|
|
],
|
|
"end": [
|
|
2,
|
|
20
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'c' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
2,
|
|
22
|
|
],
|
|
"end": [
|
|
2,
|
|
23
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'd' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
2,
|
|
24
|
|
],
|
|
"end": [
|
|
2,
|
|
30
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'string' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
2,
|
|
32
|
|
],
|
|
"end": [
|
|
2,
|
|
35
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'int' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
2,
|
|
36
|
|
],
|
|
"end": [
|
|
2,
|
|
38
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the '{}' block"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
3,
|
|
6
|
|
],
|
|
"end": [
|
|
3,
|
|
8
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'fc' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
3,
|
|
8
|
|
],
|
|
"end": [
|
|
3,
|
|
10
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the '()' arguments"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
3,
|
|
12
|
|
],
|
|
"end": [
|
|
3,
|
|
15
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'int' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
3,
|
|
17
|
|
],
|
|
"end": [
|
|
3,
|
|
22
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'error' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
3,
|
|
24
|
|
],
|
|
"end": [
|
|
3,
|
|
26
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the '{}' block"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
4,
|
|
6
|
|
],
|
|
"end": [
|
|
4,
|
|
8
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'fd' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
4,
|
|
8
|
|
],
|
|
"end": [
|
|
4,
|
|
10
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the '()' arguments"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
4,
|
|
12
|
|
],
|
|
"end": [
|
|
4,
|
|
18
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'result' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
4,
|
|
19
|
|
],
|
|
"end": [
|
|
4,
|
|
22
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'int' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
4,
|
|
24
|
|
],
|
|
"end": [
|
|
4,
|
|
27
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'err' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
4,
|
|
28
|
|
],
|
|
"end": [
|
|
4,
|
|
33
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'error' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
4,
|
|
35
|
|
],
|
|
"end": [
|
|
4,
|
|
37
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the '{}' block"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
5,
|
|
1
|
|
],
|
|
"end": [
|
|
5,
|
|
13
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'f1' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
6,
|
|
6
|
|
],
|
|
"end": [
|
|
6,
|
|
8
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'f2' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
6,
|
|
9
|
|
],
|
|
"end": [
|
|
6,
|
|
10
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'a' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
6,
|
|
11
|
|
],
|
|
"end": [
|
|
6,
|
|
14
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'int' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
6,
|
|
16
|
|
],
|
|
"end": [
|
|
6,
|
|
17
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'b' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
6,
|
|
19
|
|
],
|
|
"end": [
|
|
6,
|
|
20
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'c' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
6,
|
|
22
|
|
],
|
|
"end": [
|
|
6,
|
|
23
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'd' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
6,
|
|
24
|
|
],
|
|
"end": [
|
|
6,
|
|
30
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'string' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
6,
|
|
32
|
|
],
|
|
"end": [
|
|
6,
|
|
35
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'int' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
6,
|
|
36
|
|
],
|
|
"end": [
|
|
6,
|
|
38
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the '{}' block"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
7,
|
|
6
|
|
],
|
|
"end": [
|
|
7,
|
|
8
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'f2' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
7,
|
|
8
|
|
],
|
|
"end": [
|
|
7,
|
|
10
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the '()' arguments"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
7,
|
|
12
|
|
],
|
|
"end": [
|
|
7,
|
|
15
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'int' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
7,
|
|
17
|
|
],
|
|
"end": [
|
|
7,
|
|
22
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'error' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
7,
|
|
24
|
|
],
|
|
"end": [
|
|
7,
|
|
26
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the '{}' block"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
8,
|
|
6
|
|
],
|
|
"end": [
|
|
8,
|
|
8
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'f2' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
8,
|
|
8
|
|
],
|
|
"end": [
|
|
8,
|
|
10
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the '()' arguments"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
8,
|
|
12
|
|
],
|
|
"end": [
|
|
8,
|
|
18
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'result' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
8,
|
|
19
|
|
],
|
|
"end": [
|
|
8,
|
|
22
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'int' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
8,
|
|
24
|
|
],
|
|
"end": [
|
|
8,
|
|
27
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'err' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
8,
|
|
28
|
|
],
|
|
"end": [
|
|
8,
|
|
33
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'error' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
8,
|
|
35
|
|
],
|
|
"end": [
|
|
8,
|
|
37
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the '{}' block"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
5,
|
|
1
|
|
],
|
|
"end": [
|
|
5,
|
|
13
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'fa' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
6,
|
|
6
|
|
],
|
|
"end": [
|
|
6,
|
|
8
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'fb' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
6,
|
|
9
|
|
],
|
|
"end": [
|
|
6,
|
|
10
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'a' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
6,
|
|
11
|
|
],
|
|
"end": [
|
|
6,
|
|
14
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'int' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
6,
|
|
16
|
|
],
|
|
"end": [
|
|
6,
|
|
17
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'b' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
6,
|
|
19
|
|
],
|
|
"end": [
|
|
6,
|
|
20
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'c' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
6,
|
|
22
|
|
],
|
|
"end": [
|
|
6,
|
|
23
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'd' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
6,
|
|
24
|
|
],
|
|
"end": [
|
|
6,
|
|
30
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'string' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
6,
|
|
32
|
|
],
|
|
"end": [
|
|
6,
|
|
35
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'int' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
6,
|
|
36
|
|
],
|
|
"end": [
|
|
6,
|
|
38
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the '{}' block"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
7,
|
|
6
|
|
],
|
|
"end": [
|
|
7,
|
|
8
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'fc' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
7,
|
|
8
|
|
],
|
|
"end": [
|
|
7,
|
|
10
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the '()' arguments"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
7,
|
|
12
|
|
],
|
|
"end": [
|
|
7,
|
|
15
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'int' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
7,
|
|
17
|
|
],
|
|
"end": [
|
|
7,
|
|
22
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'error' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
7,
|
|
24
|
|
],
|
|
"end": [
|
|
7,
|
|
26
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the '{}' block"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
8,
|
|
6
|
|
],
|
|
"end": [
|
|
8,
|
|
8
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'fd' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
8,
|
|
8
|
|
],
|
|
"end": [
|
|
8,
|
|
10
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the '()' arguments"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
8,
|
|
12
|
|
],
|
|
"end": [
|
|
8,
|
|
18
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'result' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
8,
|
|
19
|
|
],
|
|
"end": [
|
|
8,
|
|
22
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'int' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
8,
|
|
24
|
|
],
|
|
"end": [
|
|
8,
|
|
27
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'err' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
8,
|
|
28
|
|
],
|
|
"end": [
|
|
8,
|
|
33
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'error' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
8,
|
|
35
|
|
],
|
|
"end": [
|
|
8,
|
|
37
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the '{}' block"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"function-declarations.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/function-declarations.go b/function-declarations.go",
|
|
"index 768679a..306f918 100644",
|
|
"--- a/function-declarations.go",
|
|
"+++ b/function-declarations.go",
|
|
"@@ -1,12 +1,8 @@",
|
|
"-func fa() {}",
|
|
"-func fb(a int, b, c, d string) int {}",
|
|
"-func fc() (int, error) {}",
|
|
"-func fd() (result int, err error) {}",
|
|
"-func f1() {}",
|
|
"-func f2(a int, b, c, d string) int {}",
|
|
"-func f2() (int, error) {}",
|
|
"-func f2() (result int, err error) {}",
|
|
" func f1() {}",
|
|
" func f2(a int, b, c, d string) int {}",
|
|
" func f2() (int, error) {}",
|
|
" func f2() (result int, err error) {}",
|
|
"+func fa() {}",
|
|
"+func fb(a int, b, c, d string) int {}",
|
|
"+func fc() (int, error) {}",
|
|
"+func fd() (result int, err error) {}"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "6865d4d27ce65230e7fc3fbc6f51601246198248..70ec29320f4e30577a3ee53075131e8303197be3"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-function-declarations-delete-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"function-declarations.go": [
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
1,
|
|
13
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'f1' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
2,
|
|
6
|
|
],
|
|
"end": [
|
|
2,
|
|
8
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'f2' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
2,
|
|
9
|
|
],
|
|
"end": [
|
|
2,
|
|
10
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'a' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
2,
|
|
11
|
|
],
|
|
"end": [
|
|
2,
|
|
14
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'int' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
2,
|
|
16
|
|
],
|
|
"end": [
|
|
2,
|
|
17
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'b' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
2,
|
|
19
|
|
],
|
|
"end": [
|
|
2,
|
|
20
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'c' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
2,
|
|
22
|
|
],
|
|
"end": [
|
|
2,
|
|
23
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'd' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
2,
|
|
24
|
|
],
|
|
"end": [
|
|
2,
|
|
30
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'string' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
2,
|
|
32
|
|
],
|
|
"end": [
|
|
2,
|
|
35
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'int' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
2,
|
|
36
|
|
],
|
|
"end": [
|
|
2,
|
|
38
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the '{}' block"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
3,
|
|
6
|
|
],
|
|
"end": [
|
|
3,
|
|
8
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'f2' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
3,
|
|
8
|
|
],
|
|
"end": [
|
|
3,
|
|
10
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the '()' arguments"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
3,
|
|
12
|
|
],
|
|
"end": [
|
|
3,
|
|
15
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'int' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
3,
|
|
17
|
|
],
|
|
"end": [
|
|
3,
|
|
22
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'error' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
3,
|
|
24
|
|
],
|
|
"end": [
|
|
3,
|
|
26
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the '{}' block"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
4,
|
|
6
|
|
],
|
|
"end": [
|
|
4,
|
|
8
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'f2' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
4,
|
|
8
|
|
],
|
|
"end": [
|
|
4,
|
|
10
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the '()' arguments"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
4,
|
|
12
|
|
],
|
|
"end": [
|
|
4,
|
|
18
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'result' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
4,
|
|
19
|
|
],
|
|
"end": [
|
|
4,
|
|
22
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'int' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
4,
|
|
24
|
|
],
|
|
"end": [
|
|
4,
|
|
27
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'err' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
4,
|
|
28
|
|
],
|
|
"end": [
|
|
4,
|
|
33
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'error' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
4,
|
|
35
|
|
],
|
|
"end": [
|
|
4,
|
|
37
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the '{}' block"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"function-declarations.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/function-declarations.go b/function-declarations.go",
|
|
"index 306f918..cc84bb3 100644",
|
|
"--- a/function-declarations.go",
|
|
"+++ b/function-declarations.go",
|
|
"@@ -1,7 +1,3 @@",
|
|
"-func f1() {}",
|
|
"-func f2(a int, b, c, d string) int {}",
|
|
"-func f2() (int, error) {}",
|
|
"-func f2() (result int, err error) {}",
|
|
" func fa() {}",
|
|
" func fb(a int, b, c, d string) int {}",
|
|
" func fc() (int, error) {}"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "70ec29320f4e30577a3ee53075131e8303197be3..31f49d7b8107305781bab334ada4f8b58f55b4be"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-function-declarations-delete-rest-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"function-declarations.go": [
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
1,
|
|
13
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'fa' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
2,
|
|
6
|
|
],
|
|
"end": [
|
|
2,
|
|
8
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'fb' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
2,
|
|
9
|
|
],
|
|
"end": [
|
|
2,
|
|
10
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'a' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
2,
|
|
11
|
|
],
|
|
"end": [
|
|
2,
|
|
14
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'int' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
2,
|
|
16
|
|
],
|
|
"end": [
|
|
2,
|
|
17
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'b' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
2,
|
|
19
|
|
],
|
|
"end": [
|
|
2,
|
|
20
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'c' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
2,
|
|
22
|
|
],
|
|
"end": [
|
|
2,
|
|
23
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'd' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
2,
|
|
24
|
|
],
|
|
"end": [
|
|
2,
|
|
30
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'string' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
2,
|
|
32
|
|
],
|
|
"end": [
|
|
2,
|
|
35
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'int' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
2,
|
|
36
|
|
],
|
|
"end": [
|
|
2,
|
|
38
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the '{}' block"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
3,
|
|
6
|
|
],
|
|
"end": [
|
|
3,
|
|
8
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'fc' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
3,
|
|
8
|
|
],
|
|
"end": [
|
|
3,
|
|
10
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the '()' arguments"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
3,
|
|
12
|
|
],
|
|
"end": [
|
|
3,
|
|
15
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'int' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
3,
|
|
17
|
|
],
|
|
"end": [
|
|
3,
|
|
22
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'error' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
3,
|
|
24
|
|
],
|
|
"end": [
|
|
3,
|
|
26
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the '{}' block"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
4,
|
|
6
|
|
],
|
|
"end": [
|
|
4,
|
|
8
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'fd' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
4,
|
|
8
|
|
],
|
|
"end": [
|
|
4,
|
|
10
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the '()' arguments"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
4,
|
|
12
|
|
],
|
|
"end": [
|
|
4,
|
|
18
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'result' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
4,
|
|
19
|
|
],
|
|
"end": [
|
|
4,
|
|
22
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'int' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
4,
|
|
24
|
|
],
|
|
"end": [
|
|
4,
|
|
27
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'err' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
4,
|
|
28
|
|
],
|
|
"end": [
|
|
4,
|
|
33
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'error' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
4,
|
|
35
|
|
],
|
|
"end": [
|
|
4,
|
|
37
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the '{}' block"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"function-declarations.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/function-declarations.go b/function-declarations.go",
|
|
"index cc84bb3..e69de29 100644",
|
|
"--- a/function-declarations.go",
|
|
"+++ b/function-declarations.go",
|
|
"@@ -1,4 +0,0 @@",
|
|
"-func fa() {}",
|
|
"-func fb(a int, b, c, d string) int {}",
|
|
"-func fc() (int, error) {}",
|
|
"-func fd() (result int, err error) {}"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "31f49d7b8107305781bab334ada4f8b58f55b4be..3eab3ce6b5947a0413a4b971f0c4c4ebf8872c2a"
|
|
}]
|