mirror of
https://github.com/github/semantic.git
synced 2024-12-23 23:11:50 +03:00
473 lines
15 KiB
JSON
473 lines
15 KiB
JSON
[{
|
|
"testCaseDescription": "go-short-var-declarations-setup-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"short-var-declarations.go": [
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
6,
|
|
1
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'main' module"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"short-var-declarations.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/short-var-declarations.go b/short-var-declarations.go",
|
|
"index e69de29..7905807 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": "a071d64ec75459dc5465a08d5179b229e8586670..825f9f49aeaf09f87cc4f4a9f97dc3800e79e268"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-short-var-declarations-insert-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"short-var-declarations.go": [
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
4,
|
|
1
|
|
],
|
|
"end": [
|
|
4,
|
|
13
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'a' variable in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
4,
|
|
1
|
|
],
|
|
"end": [
|
|
4,
|
|
13
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'b' variable in the main function of the 'main' module"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"short-var-declarations.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/short-var-declarations.go b/short-var-declarations.go",
|
|
"index 7905807..4ca1ce3 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": "825f9f49aeaf09f87cc4f4a9f97dc3800e79e268..f13e5d0b3aef3c4b043bbae9807080550c307e27"
|
|
}
|
|
,{
|
|
"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 x variable of the 'main' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
4,
|
|
9
|
|
],
|
|
"end": [
|
|
4,
|
|
10
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
4,
|
|
9
|
|
],
|
|
"end": [
|
|
4,
|
|
10
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced '1' with '3' in the x variable of 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 y variable of the 'main' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
4,
|
|
12
|
|
],
|
|
"end": [
|
|
4,
|
|
13
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
4,
|
|
12
|
|
],
|
|
"end": [
|
|
4,
|
|
13
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced '2' with '4' in the y variable of the 'main' function"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"short-var-declarations.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/short-var-declarations.go b/short-var-declarations.go",
|
|
"index 4ca1ce3..bbbf937 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": "f13e5d0b3aef3c4b043bbae9807080550c307e27..ffe84068ab77b6f68b8ce9dc3e521d476839e759"
|
|
}
|
|
,{
|
|
"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 a variable of the 'main' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
4,
|
|
9
|
|
],
|
|
"end": [
|
|
4,
|
|
10
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
4,
|
|
9
|
|
],
|
|
"end": [
|
|
4,
|
|
10
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced '3' with '1' in the a variable of 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 b variable of the 'main' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
4,
|
|
12
|
|
],
|
|
"end": [
|
|
4,
|
|
13
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
4,
|
|
12
|
|
],
|
|
"end": [
|
|
4,
|
|
13
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced '4' with '2' in the b variable of the 'main' function"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"short-var-declarations.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/short-var-declarations.go b/short-var-declarations.go",
|
|
"index bbbf937..4ca1ce3 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": "ffe84068ab77b6f68b8ce9dc3e521d476839e759..877705c02a7ba64b3ed8e168902bdfbb714467ca"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-short-var-declarations-delete-insert-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"short-var-declarations.go": [
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
4,
|
|
1
|
|
],
|
|
"end": [
|
|
4,
|
|
13
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'a' variable in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
4,
|
|
1
|
|
],
|
|
"end": [
|
|
4,
|
|
13
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'b' variable in the main function of the 'main' module"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"short-var-declarations.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/short-var-declarations.go b/short-var-declarations.go",
|
|
"index 4ca1ce3..7905807 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": "877705c02a7ba64b3ed8e168902bdfbb714467ca..0dd964cd55a4db633730d3b02c53f2757c79a608"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-short-var-declarations-teardown-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"short-var-declarations.go": [
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
6,
|
|
1
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'main' module"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"short-var-declarations.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/short-var-declarations.go b/short-var-declarations.go",
|
|
"index 7905807..e69de29 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": "0dd964cd55a4db633730d3b02c53f2757c79a608..b289186074956b2c27b9a794b0d82269d1ca416e"
|
|
}]
|