mirror of
https://github.com/github/semantic.git
synced 2024-12-23 14:54:16 +03:00
563 lines
18 KiB
JSON
563 lines
18 KiB
JSON
[{
|
|
"testCaseDescription": "go-short-var-declarations-setup-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"short-var-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": [
|
|
"short-var-declarations.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/short-var-declarations.go b/short-var-declarations.go",
|
|
"index e69de29b..79058077 100644",
|
|
"--- a/short-var-declarations.go",
|
|
"+++ b/short-var-declarations.go",
|
|
"@@ -0,0 +1,5 @@",
|
|
"+package main",
|
|
"+",
|
|
"+func main() {",
|
|
"+",
|
|
"+}"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "191ac681ab93827f81837efbd71580e5c3458338..e98e9187e07e3707791c7244bb126dc85f81008c"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-short-var-declarations-insert-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"short-var-declarations.go": [
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
4,
|
|
1
|
|
],
|
|
"end": [
|
|
4,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'a' identifier in the main function"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
4,
|
|
4
|
|
],
|
|
"end": [
|
|
4,
|
|
5
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'b' identifier in the main function"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
4,
|
|
9
|
|
],
|
|
"end": [
|
|
4,
|
|
10
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added '1' in the main function"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
4,
|
|
12
|
|
],
|
|
"end": [
|
|
4,
|
|
13
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added '2' in the main function"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"short-var-declarations.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/short-var-declarations.go b/short-var-declarations.go",
|
|
"index 79058077..4ca1ce37 100644",
|
|
"--- a/short-var-declarations.go",
|
|
"+++ b/short-var-declarations.go",
|
|
"@@ -1,5 +1,5 @@",
|
|
" package main",
|
|
" ",
|
|
" func main() {",
|
|
"-",
|
|
"+a, b := 1, 2",
|
|
" }"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "e98e9187e07e3707791c7244bb126dc85f81008c..06b193c2e046e6b3381071c51a0bc29442bf4ea0"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-short-var-declarations-replacement-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"short-var-declarations.go": [
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
4,
|
|
1
|
|
],
|
|
"end": [
|
|
4,
|
|
2
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
4,
|
|
1
|
|
],
|
|
"end": [
|
|
4,
|
|
2
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'a' identifier with the 'x' identifier in the main function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
4,
|
|
4
|
|
],
|
|
"end": [
|
|
4,
|
|
5
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
4,
|
|
4
|
|
],
|
|
"end": [
|
|
4,
|
|
5
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'b' identifier with the 'y' identifier in the main function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
4,
|
|
9
|
|
],
|
|
"end": [
|
|
4,
|
|
10
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
4,
|
|
9
|
|
],
|
|
"end": [
|
|
4,
|
|
10
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced '1' with '3' in the main function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
4,
|
|
12
|
|
],
|
|
"end": [
|
|
4,
|
|
13
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
4,
|
|
12
|
|
],
|
|
"end": [
|
|
4,
|
|
13
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced '2' with '4' in the main function"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"short-var-declarations.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/short-var-declarations.go b/short-var-declarations.go",
|
|
"index 4ca1ce37..bbbf9372 100644",
|
|
"--- a/short-var-declarations.go",
|
|
"+++ b/short-var-declarations.go",
|
|
"@@ -1,5 +1,5 @@",
|
|
" package main",
|
|
" ",
|
|
" func main() {",
|
|
"-a, b := 1, 2",
|
|
"+x, y := 3, 4",
|
|
" }"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "06b193c2e046e6b3381071c51a0bc29442bf4ea0..744129e1284c9d06f11aff320222d28ce4dafd91"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-short-var-declarations-delete-replacement-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"short-var-declarations.go": [
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
4,
|
|
1
|
|
],
|
|
"end": [
|
|
4,
|
|
2
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
4,
|
|
1
|
|
],
|
|
"end": [
|
|
4,
|
|
2
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'x' identifier with the 'a' identifier in the main function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
4,
|
|
4
|
|
],
|
|
"end": [
|
|
4,
|
|
5
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
4,
|
|
4
|
|
],
|
|
"end": [
|
|
4,
|
|
5
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'y' identifier with the 'b' identifier in the main function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
4,
|
|
9
|
|
],
|
|
"end": [
|
|
4,
|
|
10
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
4,
|
|
9
|
|
],
|
|
"end": [
|
|
4,
|
|
10
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced '3' with '1' in the main function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
4,
|
|
12
|
|
],
|
|
"end": [
|
|
4,
|
|
13
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
4,
|
|
12
|
|
],
|
|
"end": [
|
|
4,
|
|
13
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced '4' with '2' in the main function"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"short-var-declarations.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/short-var-declarations.go b/short-var-declarations.go",
|
|
"index bbbf9372..4ca1ce37 100644",
|
|
"--- a/short-var-declarations.go",
|
|
"+++ b/short-var-declarations.go",
|
|
"@@ -1,5 +1,5 @@",
|
|
" package main",
|
|
" ",
|
|
" func main() {",
|
|
"-x, y := 3, 4",
|
|
"+a, b := 1, 2",
|
|
" }"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "744129e1284c9d06f11aff320222d28ce4dafd91..bbdf12fd81e4ea05eb068154e1cf75e58b0270d0"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-short-var-declarations-delete-insert-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"short-var-declarations.go": [
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
4,
|
|
1
|
|
],
|
|
"end": [
|
|
4,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'a' identifier in the main function"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
4,
|
|
4
|
|
],
|
|
"end": [
|
|
4,
|
|
5
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'b' identifier in the main function"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
4,
|
|
9
|
|
],
|
|
"end": [
|
|
4,
|
|
10
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted '1' in the main function"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
4,
|
|
12
|
|
],
|
|
"end": [
|
|
4,
|
|
13
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted '2' in the main function"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"short-var-declarations.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/short-var-declarations.go b/short-var-declarations.go",
|
|
"index 4ca1ce37..79058077 100644",
|
|
"--- a/short-var-declarations.go",
|
|
"+++ b/short-var-declarations.go",
|
|
"@@ -1,5 +1,5 @@",
|
|
" package main",
|
|
" ",
|
|
" func main() {",
|
|
"-a, b := 1, 2",
|
|
"+",
|
|
" }"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "bbdf12fd81e4ea05eb068154e1cf75e58b0270d0..4c18bbff932ed6c0ac765f27e2ca14bee5afb01f"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-short-var-declarations-teardown-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"short-var-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": [
|
|
"short-var-declarations.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/short-var-declarations.go b/short-var-declarations.go",
|
|
"index 79058077..e69de29b 100644",
|
|
"--- a/short-var-declarations.go",
|
|
"+++ b/short-var-declarations.go",
|
|
"@@ -1,5 +0,0 @@",
|
|
"-package main",
|
|
"-",
|
|
"-func main() {",
|
|
"-",
|
|
"-}"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "4c18bbff932ed6c0ac765f27e2ca14bee5afb01f..7e0f9dd5fa5420c61c8fff7cc5794bc367fc399a"
|
|
}]
|