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/select-statements.json
2016-12-07 13:26:31 -05:00

423 lines
13 KiB
JSON

[{
"testCaseDescription": "go-select-statements-setup-test",
"expectedResult": {
"changes": {
"select-statements.go": [
{
"span": {
"insert": {
"start": [
1,
1
],
"end": [
6,
1
]
}
},
"summary": "Added the 'main' module"
}
]
},
"errors": {}
},
"filePaths": [
"select-statements.go"
],
"patch": [
"diff --git a/select-statements.go b/select-statements.go",
"index e69de29..7905807 100644",
"--- a/select-statements.go",
"+++ b/select-statements.go",
"@@ -0,0 +1,5 @@",
"+package main",
"+",
"+func main() {",
"+",
"+}"
],
"gitDir": "test/corpus/repos/go",
"shas": "680c2671d86088d9bc9c1a317cd3dd7dcc8036a8..df667a3a6c8e37f01514a493f634193333fb29b7"
}
,{
"testCaseDescription": "go-select-statements-insert-test",
"expectedResult": {
"changes": {
"select-statements.go": [
{
"span": {
"insert": {
"start": [
4,
1
],
"end": [
13,
2
]
}
},
"summary": "Added a select statement in the main function of the 'main' module"
}
]
},
"errors": {}
},
"filePaths": [
"select-statements.go"
],
"patch": [
"diff --git a/select-statements.go b/select-statements.go",
"index 7905807..6806fa6 100644",
"--- a/select-statements.go",
"+++ b/select-statements.go",
"@@ -1,5 +1,14 @@",
" package main",
" ",
" func main() {",
"-",
"+select {",
"+ case x := <-c:",
"+ println(x)",
"+ case y <- c:",
"+ println(5)",
"+ case <-time.After(1):",
"+ println(6)",
"+ default:",
"+ return",
"+}",
" }"
],
"gitDir": "test/corpus/repos/go",
"shas": "df667a3a6c8e37f01514a493f634193333fb29b7..ad9caf17cefd86902a28c135c34791795ffd715c"
}
,{
"testCaseDescription": "go-select-statements-replacement-test",
"expectedResult": {
"changes": {
"select-statements.go": [
{
"span": {
"replace": [
{
"start": [
5,
8
],
"end": [
5,
9
]
},
{
"start": [
5,
8
],
"end": [
5,
9
]
}
]
},
"summary": "Replaced the 'x' identifier with the 'a' identifier in the main function of the 'main' module"
},
{
"span": {
"replace": [
{
"start": [
7,
8
],
"end": [
7,
9
]
},
{
"start": [
7,
8
],
"end": [
7,
9
]
}
]
},
"summary": "Replaced the 'y' identifier with the 'b' identifier in the main function of the 'main' module"
},
{
"span": {
"replace": [
{
"start": [
9,
21
],
"end": [
9,
22
]
},
{
"start": [
9,
21
],
"end": [
9,
22
]
}
]
},
"summary": "Replaced '1' with '2' in the time[After](2) function call of the 'main' function"
}
]
},
"errors": {}
},
"filePaths": [
"select-statements.go"
],
"patch": [
"diff --git a/select-statements.go b/select-statements.go",
"index 6806fa6..1ca26fb 100644",
"--- a/select-statements.go",
"+++ b/select-statements.go",
"@@ -2,11 +2,11 @@ package main",
" ",
" func main() {",
" select {",
"- case x := <-c:",
"+ case a := <-c:",
" println(x)",
"- case y <- c:",
"+ case b <- c:",
" println(5)",
"- case <-time.After(1):",
"+ case <-time.After(2):",
" println(6)",
" default:",
" return"
],
"gitDir": "test/corpus/repos/go",
"shas": "ad9caf17cefd86902a28c135c34791795ffd715c..4f2b1e57742ceece5b417a62f655c0f04bc440cc"
}
,{
"testCaseDescription": "go-select-statements-delete-replacement-test",
"expectedResult": {
"changes": {
"select-statements.go": [
{
"span": {
"replace": [
{
"start": [
5,
8
],
"end": [
5,
9
]
},
{
"start": [
5,
8
],
"end": [
5,
9
]
}
]
},
"summary": "Replaced the 'a' identifier with the 'x' identifier in the main function of the 'main' module"
},
{
"span": {
"replace": [
{
"start": [
7,
8
],
"end": [
7,
9
]
},
{
"start": [
7,
8
],
"end": [
7,
9
]
}
]
},
"summary": "Replaced the 'b' identifier with the 'y' identifier in the main function of the 'main' module"
},
{
"span": {
"replace": [
{
"start": [
9,
21
],
"end": [
9,
22
]
},
{
"start": [
9,
21
],
"end": [
9,
22
]
}
]
},
"summary": "Replaced '2' with '1' in the time[After](1) function call of the 'main' function"
}
]
},
"errors": {}
},
"filePaths": [
"select-statements.go"
],
"patch": [
"diff --git a/select-statements.go b/select-statements.go",
"index 1ca26fb..6806fa6 100644",
"--- a/select-statements.go",
"+++ b/select-statements.go",
"@@ -2,11 +2,11 @@ package main",
" ",
" func main() {",
" select {",
"- case a := <-c:",
"+ case x := <-c:",
" println(x)",
"- case b <- c:",
"+ case y <- c:",
" println(5)",
"- case <-time.After(2):",
"+ case <-time.After(1):",
" println(6)",
" default:",
" return"
],
"gitDir": "test/corpus/repos/go",
"shas": "4f2b1e57742ceece5b417a62f655c0f04bc440cc..a8aa5e82ff08b73b381985b951bc2ef200297611"
}
,{
"testCaseDescription": "go-select-statements-delete-insert-test",
"expectedResult": {
"changes": {
"select-statements.go": [
{
"span": {
"delete": {
"start": [
4,
1
],
"end": [
13,
2
]
}
},
"summary": "Deleted a select statement in the main function of the 'main' module"
}
]
},
"errors": {}
},
"filePaths": [
"select-statements.go"
],
"patch": [
"diff --git a/select-statements.go b/select-statements.go",
"index 6806fa6..7905807 100644",
"--- a/select-statements.go",
"+++ b/select-statements.go",
"@@ -1,14 +1,5 @@",
" package main",
" ",
" func main() {",
"-select {",
"- case x := <-c:",
"- println(x)",
"- case y <- c:",
"- println(5)",
"- case <-time.After(1):",
"- println(6)",
"- default:",
"- return",
"-}",
"+",
" }"
],
"gitDir": "test/corpus/repos/go",
"shas": "a8aa5e82ff08b73b381985b951bc2ef200297611..65f30f120d1319cae951a936563c6749abaef7e1"
}
,{
"testCaseDescription": "go-select-statements-teardown-test",
"expectedResult": {
"changes": {
"select-statements.go": [
{
"span": {
"delete": {
"start": [
1,
1
],
"end": [
6,
1
]
}
},
"summary": "Deleted the 'main' module"
}
]
},
"errors": {}
},
"filePaths": [
"select-statements.go"
],
"patch": [
"diff --git a/select-statements.go b/select-statements.go",
"index 7905807..e69de29 100644",
"--- a/select-statements.go",
"+++ b/select-statements.go",
"@@ -1,5 +0,0 @@",
"-package main",
"-",
"-func main() {",
"-",
"-}"
],
"gitDir": "test/corpus/repos/go",
"shas": "65f30f120d1319cae951a936563c6749abaef7e1..f21ba099d655b37714a236465a82972c65927645"
}]