mirror of
https://github.com/github/semantic.git
synced 2024-12-23 14:54:16 +03:00
373 lines
12 KiB
JSON
373 lines
12 KiB
JSON
[{
|
|
"testCaseDescription": "go-function-literals-setup-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"function-literals.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": [
|
|
"function-literals.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/function-literals.go b/function-literals.go",
|
|
"index e69de29b..79058077 100644",
|
|
"--- a/function-literals.go",
|
|
"+++ b/function-literals.go",
|
|
"@@ -0,0 +1,5 @@",
|
|
"+package main",
|
|
"+",
|
|
"+func main() {",
|
|
"+",
|
|
"+}"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "0bd1a3a45c722927b5d7c0c96d296bc01c1b333c..e84e197d4ad2ff9748e305c50db4e72c1c1a3ddc"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-function-literals-insert-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"function-literals.go": [
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
4,
|
|
7
|
|
],
|
|
"end": [
|
|
6,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 's1' var assignment in the main function"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"function-literals.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/function-literals.go b/function-literals.go",
|
|
"index 79058077..1f4ead96 100644",
|
|
"--- a/function-literals.go",
|
|
"+++ b/function-literals.go",
|
|
"@@ -1,5 +1,7 @@",
|
|
" package main",
|
|
" ",
|
|
" func main() {",
|
|
"-",
|
|
"+const s1 = func(s string) (int, int) {",
|
|
"+return 1, 2",
|
|
"+}",
|
|
" }"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "e84e197d4ad2ff9748e305c50db4e72c1c1a3ddc..addd75371b5ff3d7fa0be9cde0077c7e1bfabc7f"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-function-literals-replacement-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"function-literals.go": [
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
4,
|
|
19
|
|
],
|
|
"end": [
|
|
4,
|
|
25
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
4,
|
|
19
|
|
],
|
|
"end": [
|
|
4,
|
|
22
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'string' identifier with the 'int' identifier in the s1 var assignment of the 'main' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
4,
|
|
17
|
|
],
|
|
"end": [
|
|
4,
|
|
18
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
4,
|
|
17
|
|
],
|
|
"end": [
|
|
4,
|
|
18
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 's' identifier with the 'b' identifier in the s1 var assignment of the 'main' function"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"function-literals.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/function-literals.go b/function-literals.go",
|
|
"index 1f4ead96..7b034662 100644",
|
|
"--- a/function-literals.go",
|
|
"+++ b/function-literals.go",
|
|
"@@ -1,7 +1,7 @@",
|
|
" package main",
|
|
" ",
|
|
" func main() {",
|
|
"-const s1 = func(s string) (int, int) {",
|
|
"+const s1 = func(b int) (string, string) {",
|
|
" return 1, 2",
|
|
" }",
|
|
" }"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "addd75371b5ff3d7fa0be9cde0077c7e1bfabc7f..21f5491b18b039ca6af88708ec576aa145bb7047"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-function-literals-delete-replacement-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"function-literals.go": [
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
4,
|
|
19
|
|
],
|
|
"end": [
|
|
4,
|
|
22
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
4,
|
|
19
|
|
],
|
|
"end": [
|
|
4,
|
|
25
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'int' identifier with the 'string' identifier in the s1 var assignment of the 'main' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
4,
|
|
17
|
|
],
|
|
"end": [
|
|
4,
|
|
18
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
4,
|
|
17
|
|
],
|
|
"end": [
|
|
4,
|
|
18
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'b' identifier with the 's' identifier in the s1 var assignment of the 'main' function"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"function-literals.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/function-literals.go b/function-literals.go",
|
|
"index 7b034662..1f4ead96 100644",
|
|
"--- a/function-literals.go",
|
|
"+++ b/function-literals.go",
|
|
"@@ -1,7 +1,7 @@",
|
|
" package main",
|
|
" ",
|
|
" func main() {",
|
|
"-const s1 = func(b int) (string, string) {",
|
|
"+const s1 = func(s string) (int, int) {",
|
|
" return 1, 2",
|
|
" }",
|
|
" }"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "21f5491b18b039ca6af88708ec576aa145bb7047..561ce05b87512b5ff6f76bba46d49525479a40d3"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-function-literals-delete-insert-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"function-literals.go": [
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
4,
|
|
7
|
|
],
|
|
"end": [
|
|
6,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 's1' var assignment in the main function"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"function-literals.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/function-literals.go b/function-literals.go",
|
|
"index 1f4ead96..79058077 100644",
|
|
"--- a/function-literals.go",
|
|
"+++ b/function-literals.go",
|
|
"@@ -1,7 +1,5 @@",
|
|
" package main",
|
|
" ",
|
|
" func main() {",
|
|
"-const s1 = func(s string) (int, int) {",
|
|
"-return 1, 2",
|
|
"-}",
|
|
"+",
|
|
" }"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "561ce05b87512b5ff6f76bba46d49525479a40d3..61be591e14b1ffb3ddbbfda5d996c340a2b0d221"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-function-literals-teardown-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"function-literals.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": [
|
|
"function-literals.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/function-literals.go b/function-literals.go",
|
|
"index 79058077..e69de29b 100644",
|
|
"--- a/function-literals.go",
|
|
"+++ b/function-literals.go",
|
|
"@@ -1,5 +0,0 @@",
|
|
"-package main",
|
|
"-",
|
|
"-func main() {",
|
|
"-",
|
|
"-}"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "61be591e14b1ffb3ddbbfda5d996c340a2b0d221..d01762bbba4dab11931c77b7e92313b7e8ac8f8d"
|
|
}]
|