mirror of
https://github.com/github/semantic.git
synced 2024-12-26 00:12:29 +03:00
617 lines
20 KiB
JSON
617 lines
20 KiB
JSON
[{
|
|
"testCaseDescription": "go-assignment-statements-setup-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"assignment-statements.go": [
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
6,
|
|
1
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'main' module"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"assignment-statements.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/assignment-statements.go b/assignment-statements.go",
|
|
"index e69de29b..79058077 100644",
|
|
"--- a/assignment-statements.go",
|
|
"+++ b/assignment-statements.go",
|
|
"@@ -0,0 +1,5 @@",
|
|
"+package main",
|
|
"+",
|
|
"+func main() {",
|
|
"+",
|
|
"+}"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "20fa55e7535a6b1108c324529279f2e8b490ca41..3dd801eb58db16a0c0ad78cdc49ac1c50256f041"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-assignment-statements-insert-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"assignment-statements.go": [
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
4,
|
|
1
|
|
],
|
|
"end": [
|
|
4,
|
|
6
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'a' var assignment in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
5,
|
|
1
|
|
],
|
|
"end": [
|
|
5,
|
|
13
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'b' var assignment in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
5,
|
|
1
|
|
],
|
|
"end": [
|
|
5,
|
|
13
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'c' var assignment in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
6,
|
|
1
|
|
],
|
|
"end": [
|
|
6,
|
|
7
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'd' var assignment in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
7,
|
|
1
|
|
],
|
|
"end": [
|
|
7,
|
|
7
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'e' var assignment in the main function of the 'main' module"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"assignment-statements.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/assignment-statements.go b/assignment-statements.go",
|
|
"index 79058077..072782b1 100644",
|
|
"--- a/assignment-statements.go",
|
|
"+++ b/assignment-statements.go",
|
|
"@@ -1,5 +1,8 @@",
|
|
" package main",
|
|
" ",
|
|
" func main() {",
|
|
"-",
|
|
"+a = 1",
|
|
"+b, c += 2, 3",
|
|
"+d *= 3",
|
|
"+e += 1",
|
|
" }"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "3dd801eb58db16a0c0ad78cdc49ac1c50256f041..c1749b81e7947fa1a2a018431e837bf244933ccc"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-assignment-statements-replacement-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"assignment-statements.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 var assignment of the 'main' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
5,
|
|
1
|
|
],
|
|
"end": [
|
|
5,
|
|
2
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
5,
|
|
1
|
|
],
|
|
"end": [
|
|
5,
|
|
2
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'b' identifier with the 'y' identifier in the y var assignment of the 'main' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
6,
|
|
1
|
|
],
|
|
"end": [
|
|
6,
|
|
7
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'z' var assignment in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
7,
|
|
1
|
|
],
|
|
"end": [
|
|
7,
|
|
7
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'h' var assignment in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
6,
|
|
1
|
|
],
|
|
"end": [
|
|
6,
|
|
7
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'd' var assignment in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
7,
|
|
1
|
|
],
|
|
"end": [
|
|
7,
|
|
7
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'e' var assignment in the main function of the 'main' module"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"assignment-statements.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/assignment-statements.go b/assignment-statements.go",
|
|
"index 072782b1..2e6b444c 100644",
|
|
"--- a/assignment-statements.go",
|
|
"+++ b/assignment-statements.go",
|
|
"@@ -1,8 +1,8 @@",
|
|
" package main",
|
|
" ",
|
|
" func main() {",
|
|
"-a = 1",
|
|
"-b, c += 2, 3",
|
|
"-d *= 3",
|
|
"-e += 1",
|
|
"+x = 1",
|
|
"+y, c += 2, 3",
|
|
"+z *= 3",
|
|
"+h += 1",
|
|
" }"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "c1749b81e7947fa1a2a018431e837bf244933ccc..183f8301622c6ef185d5047e7f120a789b8dc8b1"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-assignment-statements-delete-replacement-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"assignment-statements.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 var assignment of the 'main' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
5,
|
|
1
|
|
],
|
|
"end": [
|
|
5,
|
|
2
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
5,
|
|
1
|
|
],
|
|
"end": [
|
|
5,
|
|
2
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'y' identifier with the 'b' identifier in the b var assignment of the 'main' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
6,
|
|
1
|
|
],
|
|
"end": [
|
|
6,
|
|
7
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'd' var assignment in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
6,
|
|
1
|
|
],
|
|
"end": [
|
|
6,
|
|
2
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
7,
|
|
1
|
|
],
|
|
"end": [
|
|
7,
|
|
2
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'z' identifier with the 'e' identifier in the e var assignment of the 'main' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
6,
|
|
6
|
|
],
|
|
"end": [
|
|
6,
|
|
7
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
7,
|
|
6
|
|
],
|
|
"end": [
|
|
7,
|
|
7
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced '3' with '1' in the e var assignment of the 'main' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
7,
|
|
1
|
|
],
|
|
"end": [
|
|
7,
|
|
7
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'h' var assignment in the main function of the 'main' module"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"assignment-statements.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/assignment-statements.go b/assignment-statements.go",
|
|
"index 2e6b444c..072782b1 100644",
|
|
"--- a/assignment-statements.go",
|
|
"+++ b/assignment-statements.go",
|
|
"@@ -1,8 +1,8 @@",
|
|
" package main",
|
|
" ",
|
|
" func main() {",
|
|
"-x = 1",
|
|
"-y, c += 2, 3",
|
|
"-z *= 3",
|
|
"-h += 1",
|
|
"+a = 1",
|
|
"+b, c += 2, 3",
|
|
"+d *= 3",
|
|
"+e += 1",
|
|
" }"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "183f8301622c6ef185d5047e7f120a789b8dc8b1..a56b78cc0505be75ec9ed461dc8c1f8d2dddb24e"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-assignment-statements-delete-insert-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"assignment-statements.go": [
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
4,
|
|
1
|
|
],
|
|
"end": [
|
|
4,
|
|
6
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'a' var assignment in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
5,
|
|
1
|
|
],
|
|
"end": [
|
|
5,
|
|
13
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'b' var assignment in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
5,
|
|
1
|
|
],
|
|
"end": [
|
|
5,
|
|
13
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'c' var assignment in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
6,
|
|
1
|
|
],
|
|
"end": [
|
|
6,
|
|
7
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'd' var assignment in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
7,
|
|
1
|
|
],
|
|
"end": [
|
|
7,
|
|
7
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'e' var assignment in the main function of the 'main' module"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"assignment-statements.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/assignment-statements.go b/assignment-statements.go",
|
|
"index 072782b1..79058077 100644",
|
|
"--- a/assignment-statements.go",
|
|
"+++ b/assignment-statements.go",
|
|
"@@ -1,8 +1,5 @@",
|
|
" package main",
|
|
" ",
|
|
" func main() {",
|
|
"-a = 1",
|
|
"-b, c += 2, 3",
|
|
"-d *= 3",
|
|
"-e += 1",
|
|
"+",
|
|
" }"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "a56b78cc0505be75ec9ed461dc8c1f8d2dddb24e..488ae20a83705cfe2cf4c8bd37a6a4526d625ccb"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-assignment-statements-teardown-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"assignment-statements.go": [
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
6,
|
|
1
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'main' module"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"assignment-statements.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/assignment-statements.go b/assignment-statements.go",
|
|
"index 79058077..e69de29b 100644",
|
|
"--- a/assignment-statements.go",
|
|
"+++ b/assignment-statements.go",
|
|
"@@ -1,5 +0,0 @@",
|
|
"-package main",
|
|
"-",
|
|
"-func main() {",
|
|
"-",
|
|
"-}"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "488ae20a83705cfe2cf4c8bd37a6a4526d625ccb..bff82271f316995218c2faaeaf34916b251bd406"
|
|
}]
|