mirror of
https://github.com/github/semantic.git
synced 2024-12-23 14:54:16 +03:00
479 lines
16 KiB
JSON
479 lines
16 KiB
JSON
[{
|
|
"testCaseDescription": "go-go-and-defer-statements-setup-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"go-and-defer-statements.go": [
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
6,
|
|
1
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'main' module"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"go-and-defer-statements.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/go-and-defer-statements.go b/go-and-defer-statements.go",
|
|
"index e69de29..7905807 100644",
|
|
"--- a/go-and-defer-statements.go",
|
|
"+++ b/go-and-defer-statements.go",
|
|
"@@ -0,0 +1,5 @@",
|
|
"+package main",
|
|
"+",
|
|
"+func main() {",
|
|
"+",
|
|
"+}"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "a5f852527c8fcb9cba59c33dce09153cbedc2f56..e9b0b725f1dc0d05c9314f3d044364c70b3b0be5"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-go-and-defer-statements-insert-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"go-and-defer-statements.go": [
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
4,
|
|
1
|
|
],
|
|
"end": [
|
|
4,
|
|
12
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'x[y]()' defer statement in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
5,
|
|
1
|
|
],
|
|
"end": [
|
|
5,
|
|
9
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'x[y]()' go statement in the main function of the 'main' module"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"go-and-defer-statements.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/go-and-defer-statements.go b/go-and-defer-statements.go",
|
|
"index 7905807..4eab499 100644",
|
|
"--- a/go-and-defer-statements.go",
|
|
"+++ b/go-and-defer-statements.go",
|
|
"@@ -1,5 +1,6 @@",
|
|
" package main",
|
|
" ",
|
|
" func main() {",
|
|
"-",
|
|
"+defer x.y()",
|
|
"+go x.y()",
|
|
" }"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "e9b0b725f1dc0d05c9314f3d044364c70b3b0be5..69ddfae3a22f54d8136d900c93565daffb81253d"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-go-and-defer-statements-replacement-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"go-and-defer-statements.go": [
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
4,
|
|
7
|
|
],
|
|
"end": [
|
|
4,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
4,
|
|
7
|
|
],
|
|
"end": [
|
|
4,
|
|
8
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'x' identifier with the 'a' identifier in the a[b] subscript access of the 'main' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
4,
|
|
9
|
|
],
|
|
"end": [
|
|
4,
|
|
10
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
4,
|
|
9
|
|
],
|
|
"end": [
|
|
4,
|
|
10
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'y' identifier with the 'b' identifier in the a[b] subscript access of the 'main' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
5,
|
|
4
|
|
],
|
|
"end": [
|
|
5,
|
|
5
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
5,
|
|
4
|
|
],
|
|
"end": [
|
|
5,
|
|
5
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'x' identifier with the 'c' identifier in the c[d] subscript access of the 'main' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
5,
|
|
6
|
|
],
|
|
"end": [
|
|
5,
|
|
7
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
5,
|
|
6
|
|
],
|
|
"end": [
|
|
5,
|
|
7
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'y' identifier with the 'd' identifier in the c[d] subscript access of the 'main' function"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"go-and-defer-statements.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/go-and-defer-statements.go b/go-and-defer-statements.go",
|
|
"index 4eab499..0537c4b 100644",
|
|
"--- a/go-and-defer-statements.go",
|
|
"+++ b/go-and-defer-statements.go",
|
|
"@@ -1,6 +1,6 @@",
|
|
" package main",
|
|
" ",
|
|
" func main() {",
|
|
"-defer x.y()",
|
|
"-go x.y()",
|
|
"+defer a.b()",
|
|
"+go c.d()",
|
|
" }"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "69ddfae3a22f54d8136d900c93565daffb81253d..7e22ba8bc3d3610d6b97204c6fdd6500fd7a51a3"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-go-and-defer-statements-delete-replacement-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"go-and-defer-statements.go": [
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
4,
|
|
7
|
|
],
|
|
"end": [
|
|
4,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
4,
|
|
7
|
|
],
|
|
"end": [
|
|
4,
|
|
8
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'a' identifier with the 'x' identifier in the x[y] subscript access of the 'main' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
4,
|
|
9
|
|
],
|
|
"end": [
|
|
4,
|
|
10
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
4,
|
|
9
|
|
],
|
|
"end": [
|
|
4,
|
|
10
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'b' identifier with the 'y' identifier in the x[y] subscript access of the 'main' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
5,
|
|
4
|
|
],
|
|
"end": [
|
|
5,
|
|
5
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
5,
|
|
4
|
|
],
|
|
"end": [
|
|
5,
|
|
5
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'c' identifier with the 'x' identifier in the x[y] subscript access of the 'main' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
5,
|
|
6
|
|
],
|
|
"end": [
|
|
5,
|
|
7
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
5,
|
|
6
|
|
],
|
|
"end": [
|
|
5,
|
|
7
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'd' identifier with the 'y' identifier in the x[y] subscript access of the 'main' function"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"go-and-defer-statements.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/go-and-defer-statements.go b/go-and-defer-statements.go",
|
|
"index 0537c4b..4eab499 100644",
|
|
"--- a/go-and-defer-statements.go",
|
|
"+++ b/go-and-defer-statements.go",
|
|
"@@ -1,6 +1,6 @@",
|
|
" package main",
|
|
" ",
|
|
" func main() {",
|
|
"-defer a.b()",
|
|
"-go c.d()",
|
|
"+defer x.y()",
|
|
"+go x.y()",
|
|
" }"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "7e22ba8bc3d3610d6b97204c6fdd6500fd7a51a3..ac429012f46840ca8c09f5d3cf83ae87e8822233"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-go-and-defer-statements-delete-insert-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"go-and-defer-statements.go": [
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
4,
|
|
1
|
|
],
|
|
"end": [
|
|
4,
|
|
12
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'x[y]()' defer statement in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
5,
|
|
1
|
|
],
|
|
"end": [
|
|
5,
|
|
9
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'x[y]()' go statement in the main function of the 'main' module"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"go-and-defer-statements.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/go-and-defer-statements.go b/go-and-defer-statements.go",
|
|
"index 4eab499..7905807 100644",
|
|
"--- a/go-and-defer-statements.go",
|
|
"+++ b/go-and-defer-statements.go",
|
|
"@@ -1,6 +1,5 @@",
|
|
" package main",
|
|
" ",
|
|
" func main() {",
|
|
"-defer x.y()",
|
|
"-go x.y()",
|
|
"+",
|
|
" }"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "ac429012f46840ca8c09f5d3cf83ae87e8822233..7db729225506b7bf5f31fbd5bacde3d47da70ff4"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-go-and-defer-statements-teardown-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"go-and-defer-statements.go": [
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
6,
|
|
1
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'main' module"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"go-and-defer-statements.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/go-and-defer-statements.go b/go-and-defer-statements.go",
|
|
"index 7905807..e69de29 100644",
|
|
"--- a/go-and-defer-statements.go",
|
|
"+++ b/go-and-defer-statements.go",
|
|
"@@ -1,5 +0,0 @@",
|
|
"-package main",
|
|
"-",
|
|
"-func main() {",
|
|
"-",
|
|
"-}"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "7db729225506b7bf5f31fbd5bacde3d47da70ff4..cd26fcae0f7eeb2dd98189ea55832aaa6f16e9e6"
|
|
}]
|