1
1
mirror of https://github.com/github/semantic.git synced 2025-01-09 00:56:32 +03:00
semantic/test/corpus/diff-summaries/go/single-line-function-declarations.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": "7ebca2c2e26873ec2ec3d92c6922446eb95bb61f..cfc5ed7d21deace3c8eabd9d394e916da7e41a46"
}
,{
"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": "cfc5ed7d21deace3c8eabd9d394e916da7e41a46..978bbef12122d7954da3d7f7dfa67cfea28a84f9"
}
,{
"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": "978bbef12122d7954da3d7f7dfa67cfea28a84f9..2896a28ff80236db618c50ceb2b9d9469a4ea425"
}
,{
"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": "2896a28ff80236db618c50ceb2b9d9469a4ea425..94b20a0aaf7aef755357df422b0f96413e3532f9"
}
,{
"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": "94b20a0aaf7aef755357df422b0f96413e3532f9..911d3b87f28310cf84bd22c59757753c61dca6c4"
}
,{
"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": "911d3b87f28310cf84bd22c59757753c61dca6c4..aa75d831de9909c8ed71c01ca49d0b4ef4e4b7e8"
}]