mirror of
https://github.com/github/semantic.git
synced 2024-12-23 14:54:16 +03:00
659 lines
22 KiB
JSON
659 lines
22 KiB
JSON
[{
|
|
"testCaseDescription": "go-single-line-function-declarations-setup-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"single-line-function-declarations.go": [
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
1,
|
|
13
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
3,
|
|
1
|
|
],
|
|
"end": [
|
|
5,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'main' function"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"single-line-function-declarations.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/single-line-function-declarations.go b/single-line-function-declarations.go",
|
|
"index e69de29b..79058077 100644",
|
|
"--- a/single-line-function-declarations.go",
|
|
"+++ b/single-line-function-declarations.go",
|
|
"@@ -0,0 +1,5 @@",
|
|
"+package main",
|
|
"+",
|
|
"+func main() {",
|
|
"+",
|
|
"+}"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "fa40f11704559b74697a16a5ddfe4827c1fc1c3f..0810fe9e1b6c8aa06b202cdbc6f8513ce07b230d"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-single-line-function-declarations-insert-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"single-line-function-declarations.go": [
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
4,
|
|
13
|
|
],
|
|
"end": [
|
|
4,
|
|
16
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'a()' function call in the main function"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
5,
|
|
13
|
|
],
|
|
"end": [
|
|
5,
|
|
16
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'a()' function call in the main function"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
5,
|
|
18
|
|
],
|
|
"end": [
|
|
5,
|
|
21
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'b()' function call in the main function"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
6,
|
|
13
|
|
],
|
|
"end": [
|
|
6,
|
|
16
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'a()' function call in the main function"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
6,
|
|
18
|
|
],
|
|
"end": [
|
|
6,
|
|
21
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'b()' function call in the main function"
|
|
}
|
|
]
|
|
},
|
|
"errors": {
|
|
"single-line-function-declarations.go": [
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
4,
|
|
1
|
|
],
|
|
"end": [
|
|
4,
|
|
10
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added 'func f1()' at line 4, column 1 - line 4, column 10 in the main function"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
5,
|
|
1
|
|
],
|
|
"end": [
|
|
5,
|
|
10
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added 'func f2()' at line 5, column 1 - line 5, column 10 in the main function"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
6,
|
|
1
|
|
],
|
|
"end": [
|
|
6,
|
|
10
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added 'func f3()' at line 6, column 1 - line 6, column 10 in the main function"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"filePaths": [
|
|
"single-line-function-declarations.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/single-line-function-declarations.go b/single-line-function-declarations.go",
|
|
"index 79058077..0339b429 100644",
|
|
"--- a/single-line-function-declarations.go",
|
|
"+++ b/single-line-function-declarations.go",
|
|
"@@ -1,5 +1,7 @@",
|
|
" package main",
|
|
" ",
|
|
" func main() {",
|
|
"-",
|
|
"+func f1() { a() }",
|
|
"+func f2() { a(); b() }",
|
|
"+func f3() { a(); b(); }",
|
|
" }"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "0810fe9e1b6c8aa06b202cdbc6f8513ce07b230d..9f3f971e268cd78e335c12880f615d85b7745a54"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-single-line-function-declarations-replacement-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"single-line-function-declarations.go": [
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
4,
|
|
6
|
|
],
|
|
"end": [
|
|
4,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
4,
|
|
6
|
|
],
|
|
"end": [
|
|
4,
|
|
8
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'f1' identifier with the 'g1' identifier in the g1() function call of the 'main' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
6,
|
|
6
|
|
],
|
|
"end": [
|
|
6,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
6,
|
|
6
|
|
],
|
|
"end": [
|
|
6,
|
|
8
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'f3' identifier with the 'g3' identifier in the g3() function call of the 'main' function"
|
|
}
|
|
]
|
|
},
|
|
"errors": {
|
|
"single-line-function-declarations.go": [
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
5,
|
|
1
|
|
],
|
|
"end": [
|
|
5,
|
|
10
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added 'func g2()' at line 5, column 1 - line 5, column 10 in the main function"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
5,
|
|
1
|
|
],
|
|
"end": [
|
|
5,
|
|
10
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted 'func f2()' at line 5, column 1 - line 5, column 10 in the main function"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"filePaths": [
|
|
"single-line-function-declarations.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/single-line-function-declarations.go b/single-line-function-declarations.go",
|
|
"index 0339b429..5bfe23f4 100644",
|
|
"--- a/single-line-function-declarations.go",
|
|
"+++ b/single-line-function-declarations.go",
|
|
"@@ -1,7 +1,7 @@",
|
|
" package main",
|
|
" ",
|
|
" func main() {",
|
|
"-func f1() { a() }",
|
|
"-func f2() { a(); b() }",
|
|
"-func f3() { a(); b(); }",
|
|
"+func g1() { a() }",
|
|
"+func g2() { a(); b() }",
|
|
"+func g3() { a(); b(); }",
|
|
" }"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "9f3f971e268cd78e335c12880f615d85b7745a54..1d2c3c1081db6cafb50d38c7a707e1198c83d026"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-single-line-function-declarations-delete-replacement-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"single-line-function-declarations.go": [
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
4,
|
|
6
|
|
],
|
|
"end": [
|
|
4,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
4,
|
|
6
|
|
],
|
|
"end": [
|
|
4,
|
|
8
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'g1' identifier with the 'f1' identifier in the f1() function call of the 'main' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
6,
|
|
6
|
|
],
|
|
"end": [
|
|
6,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
6,
|
|
6
|
|
],
|
|
"end": [
|
|
6,
|
|
8
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'g3' identifier with the 'f3' identifier in the f3() function call of the 'main' function"
|
|
}
|
|
]
|
|
},
|
|
"errors": {
|
|
"single-line-function-declarations.go": [
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
5,
|
|
1
|
|
],
|
|
"end": [
|
|
5,
|
|
10
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added 'func f2()' at line 5, column 1 - line 5, column 10 in the main function"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
5,
|
|
1
|
|
],
|
|
"end": [
|
|
5,
|
|
10
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted 'func g2()' at line 5, column 1 - line 5, column 10 in the main function"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"filePaths": [
|
|
"single-line-function-declarations.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/single-line-function-declarations.go b/single-line-function-declarations.go",
|
|
"index 5bfe23f4..0339b429 100644",
|
|
"--- a/single-line-function-declarations.go",
|
|
"+++ b/single-line-function-declarations.go",
|
|
"@@ -1,7 +1,7 @@",
|
|
" package main",
|
|
" ",
|
|
" func main() {",
|
|
"-func g1() { a() }",
|
|
"-func g2() { a(); b() }",
|
|
"-func g3() { a(); b(); }",
|
|
"+func f1() { a() }",
|
|
"+func f2() { a(); b() }",
|
|
"+func f3() { a(); b(); }",
|
|
" }"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "1d2c3c1081db6cafb50d38c7a707e1198c83d026..d32144410732e0efd98d7c2d8201cd913b71cee6"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-single-line-function-declarations-delete-insert-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"single-line-function-declarations.go": [
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
4,
|
|
13
|
|
],
|
|
"end": [
|
|
4,
|
|
16
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'a()' function call in the main function"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
5,
|
|
13
|
|
],
|
|
"end": [
|
|
5,
|
|
16
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'a()' function call in the main function"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
5,
|
|
18
|
|
],
|
|
"end": [
|
|
5,
|
|
21
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'b()' function call in the main function"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
6,
|
|
13
|
|
],
|
|
"end": [
|
|
6,
|
|
16
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'a()' function call in the main function"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
6,
|
|
18
|
|
],
|
|
"end": [
|
|
6,
|
|
21
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'b()' function call in the main function"
|
|
}
|
|
]
|
|
},
|
|
"errors": {
|
|
"single-line-function-declarations.go": [
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
4,
|
|
1
|
|
],
|
|
"end": [
|
|
4,
|
|
10
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted 'func f1()' at line 4, column 1 - line 4, column 10 in the main function"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
5,
|
|
1
|
|
],
|
|
"end": [
|
|
5,
|
|
10
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted 'func f2()' at line 5, column 1 - line 5, column 10 in the main function"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
6,
|
|
1
|
|
],
|
|
"end": [
|
|
6,
|
|
10
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted 'func f3()' at line 6, column 1 - line 6, column 10 in the main function"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"filePaths": [
|
|
"single-line-function-declarations.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/single-line-function-declarations.go b/single-line-function-declarations.go",
|
|
"index 0339b429..79058077 100644",
|
|
"--- a/single-line-function-declarations.go",
|
|
"+++ b/single-line-function-declarations.go",
|
|
"@@ -1,7 +1,5 @@",
|
|
" package main",
|
|
" ",
|
|
" func main() {",
|
|
"-func f1() { a() }",
|
|
"-func f2() { a(); b() }",
|
|
"-func f3() { a(); b(); }",
|
|
"+",
|
|
" }"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "d32144410732e0efd98d7c2d8201cd913b71cee6..664251a2207cc59e5c2c969cd42b0acec1d3813e"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-single-line-function-declarations-teardown-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"single-line-function-declarations.go": [
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
1,
|
|
13
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
3,
|
|
1
|
|
],
|
|
"end": [
|
|
5,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'main' function"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"single-line-function-declarations.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/single-line-function-declarations.go b/single-line-function-declarations.go",
|
|
"index 79058077..e69de29b 100644",
|
|
"--- a/single-line-function-declarations.go",
|
|
"+++ b/single-line-function-declarations.go",
|
|
"@@ -1,5 +0,0 @@",
|
|
"-package main",
|
|
"-",
|
|
"-func main() {",
|
|
"-",
|
|
"-}"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "664251a2207cc59e5c2c969cd42b0acec1d3813e..c6729f44705a6dc43bcedcd145acac0c9358ba62"
|
|
}]
|