mirror of
https://github.com/github/semantic.git
synced 2024-12-23 14:54:16 +03:00
611 lines
21 KiB
JSON
611 lines
21 KiB
JSON
[{
|
|
"testCaseDescription": "go-single-line-function-declarations-setup-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"single-line-function-declarations.go": [
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
6,
|
|
1
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'main' module"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"single-line-function-declarations.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/single-line-function-declarations.go b/single-line-function-declarations.go",
|
|
"index e69de29..7905807 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": "efb4a57594d20ae6478868b54c3349cf6f800b43..728f0acbc957ecdf04eb79102c926e29334bedd0"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-single-line-function-declarations-insert-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"single-line-function-declarations.go": [
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
4,
|
|
6
|
|
],
|
|
"end": [
|
|
4,
|
|
10
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'f1()' function call in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
4,
|
|
13
|
|
],
|
|
"end": [
|
|
4,
|
|
16
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'a()' function call in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
5,
|
|
6
|
|
],
|
|
"end": [
|
|
5,
|
|
10
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'f2()' function call in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
5,
|
|
13
|
|
],
|
|
"end": [
|
|
5,
|
|
16
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'a()' function call in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
5,
|
|
18
|
|
],
|
|
"end": [
|
|
5,
|
|
21
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'b()' function call in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
6,
|
|
6
|
|
],
|
|
"end": [
|
|
6,
|
|
10
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'f3()' function call in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
6,
|
|
13
|
|
],
|
|
"end": [
|
|
6,
|
|
16
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'a()' function call in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
6,
|
|
18
|
|
],
|
|
"end": [
|
|
6,
|
|
21
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'b()' function call in the main function of the 'main' module"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"single-line-function-declarations.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/single-line-function-declarations.go b/single-line-function-declarations.go",
|
|
"index 7905807..0339b42 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": "728f0acbc957ecdf04eb79102c926e29334bedd0..4705bc9dbb8698f6d9ea2e569b1c45c6000f4ed0"
|
|
}
|
|
,{
|
|
"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": [
|
|
5,
|
|
6
|
|
],
|
|
"end": [
|
|
5,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
5,
|
|
6
|
|
],
|
|
"end": [
|
|
5,
|
|
8
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'f2' identifier with the 'g2' identifier in the g2() 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": {}
|
|
},
|
|
"filePaths": [
|
|
"single-line-function-declarations.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/single-line-function-declarations.go b/single-line-function-declarations.go",
|
|
"index 0339b42..5bfe23f 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": "4705bc9dbb8698f6d9ea2e569b1c45c6000f4ed0..04207eb8e6fdc09a5e74a145a79632a919b7ff7c"
|
|
}
|
|
,{
|
|
"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": [
|
|
5,
|
|
6
|
|
],
|
|
"end": [
|
|
5,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
5,
|
|
6
|
|
],
|
|
"end": [
|
|
5,
|
|
8
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'g2' identifier with the 'f2' identifier in the f2() 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": {}
|
|
},
|
|
"filePaths": [
|
|
"single-line-function-declarations.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/single-line-function-declarations.go b/single-line-function-declarations.go",
|
|
"index 5bfe23f..0339b42 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": "04207eb8e6fdc09a5e74a145a79632a919b7ff7c..46baf0d782767becd51d83d8b45e905f98b83c6b"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-single-line-function-declarations-delete-insert-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"single-line-function-declarations.go": [
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
4,
|
|
6
|
|
],
|
|
"end": [
|
|
4,
|
|
10
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'f1()' function call in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
4,
|
|
13
|
|
],
|
|
"end": [
|
|
4,
|
|
16
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'a()' function call in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
5,
|
|
6
|
|
],
|
|
"end": [
|
|
5,
|
|
10
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'f2()' function call in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
5,
|
|
13
|
|
],
|
|
"end": [
|
|
5,
|
|
16
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'a()' function call in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
5,
|
|
18
|
|
],
|
|
"end": [
|
|
5,
|
|
21
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'b()' function call in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
6,
|
|
6
|
|
],
|
|
"end": [
|
|
6,
|
|
10
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'f3()' function call in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
6,
|
|
13
|
|
],
|
|
"end": [
|
|
6,
|
|
16
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'a()' function call in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
6,
|
|
18
|
|
],
|
|
"end": [
|
|
6,
|
|
21
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'b()' function call in the main function of the 'main' module"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"single-line-function-declarations.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/single-line-function-declarations.go b/single-line-function-declarations.go",
|
|
"index 0339b42..7905807 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": "46baf0d782767becd51d83d8b45e905f98b83c6b..dfc63c0380caa3d1c47b3742b845a45f5cff8742"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-single-line-function-declarations-teardown-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"single-line-function-declarations.go": [
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
6,
|
|
1
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'main' module"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"single-line-function-declarations.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/single-line-function-declarations.go b/single-line-function-declarations.go",
|
|
"index 7905807..e69de29 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": "dfc63c0380caa3d1c47b3742b845a45f5cff8742..7c2e8f39e68df4ae5a362bc9e19f3b476c0e524f"
|
|
}]
|