1
1
mirror of https://github.com/github/semantic.git synced 2024-12-23 14:54:16 +03:00
semantic/test/corpus/diff-summaries/go/go-and-defer-statements.json
2017-02-06 10:44:04 -05:00

509 lines
17 KiB
JSON

[{
"testCaseDescription": "go-go-and-defer-statements-setup-test",
"expectedResult": {
"changes": {
"go-and-defer-statements.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": [
"go-and-defer-statements.go"
],
"patch": [
"diff --git a/go-and-defer-statements.go b/go-and-defer-statements.go",
"index e69de29b..79058077 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": "70d17350ea16f4d4d0cfc2d2884ffa2d16673d76..b5500c1114c110c94e2a0bf00ee8d266fb9dcb78"
}
,{
"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"
},
{
"span": {
"insert": {
"start": [
5,
1
],
"end": [
5,
9
]
}
},
"summary": "Added the 'x[y]()' go statement in 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 79058077..4eab4994 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": "b5500c1114c110c94e2a0bf00ee8d266fb9dcb78..ed5d2562fde56c9ab47b28c78cec6378fa687f3c"
}
,{
"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 4eab4994..0537c4bc 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": "ed5d2562fde56c9ab47b28c78cec6378fa687f3c..8439dbebfbc084625381e3ed0c7ccf750225ee6c"
}
,{
"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 0537c4bc..4eab4994 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": "8439dbebfbc084625381e3ed0c7ccf750225ee6c..fb0c724a6423a7cc190a9f4a3a04fcf927576d23"
}
,{
"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"
},
{
"span": {
"delete": {
"start": [
5,
1
],
"end": [
5,
9
]
}
},
"summary": "Deleted the 'x[y]()' go statement in 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 4eab4994..79058077 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": "fb0c724a6423a7cc190a9f4a3a04fcf927576d23..20c6933a74e838ea3fc37e46529869564f2366fd"
}
,{
"testCaseDescription": "go-go-and-defer-statements-teardown-test",
"expectedResult": {
"changes": {
"go-and-defer-statements.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": [
"go-and-defer-statements.go"
],
"patch": [
"diff --git a/go-and-defer-statements.go b/go-and-defer-statements.go",
"index 79058077..e69de29b 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": "20c6933a74e838ea3fc37e46529869564f2366fd..e23825ba20a9911899a12cc29fecfc4811eca175"
}]