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
2017-01-10 16:21:35 -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": "de859039e83c9bb69eac6fcc05b538a1c6b45e52..f94800376bb0cbf11f832ac1934b1537cf6cdeb3"
}
,{
"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": "f94800376bb0cbf11f832ac1934b1537cf6cdeb3..3836f75b7dbf653100d585446e2be7518891252d"
}
,{
"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": "3836f75b7dbf653100d585446e2be7518891252d..3474643b08d4cea2d378d9f20a07237260e9f730"
}
,{
"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": "3474643b08d4cea2d378d9f20a07237260e9f730..a96a0db774ab24294c7cf5ceced94944a0ba6bfc"
}
,{
"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": "a96a0db774ab24294c7cf5ceced94944a0ba6bfc..69840df62daab5d321a9e0aae7e2bb4bc2de65e9"
}
,{
"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": "69840df62daab5d321a9e0aae7e2bb4bc2de65e9..f71da83529be4b910d80b2f9bf87cc4aa9f26019"
}]