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-02-06 10:44:04 -05:00

453 lines
14 KiB
JSON

[{
"testCaseDescription": "go-select-statements-setup-test",
"expectedResult": {
"changes": {
"select-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": [
"select-statements.go"
],
"patch": [
"diff --git a/select-statements.go b/select-statements.go",
"index e69de29b..79058077 100644",
"--- a/select-statements.go",
"+++ b/select-statements.go",
"@@ -0,0 +1,5 @@",
"+package main",
"+",
"+func main() {",
"+",
"+}"
],
"gitDir": "test/corpus/repos/go",
"shas": "8975afb3caf4b410dd0191b28d41b472e6192b27..c43cfccdd1b03cbf67808b47dec668f7ad244c21"
}
,{
"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"
}
]
},
"errors": {}
},
"filePaths": [
"select-statements.go"
],
"patch": [
"diff --git a/select-statements.go b/select-statements.go",
"index 79058077..6806fa67 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": "c43cfccdd1b03cbf67808b47dec668f7ad244c21..126790db766e79909d8379b19703ed52addce808"
}
,{
"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"
},
{
"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"
},
{
"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 6806fa67..1ca26fb9 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": "126790db766e79909d8379b19703ed52addce808..cd4fc646c6d3390897cd2f1bc0f7016b34ce6433"
}
,{
"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"
},
{
"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"
},
{
"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 1ca26fb9..6806fa67 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": "cd4fc646c6d3390897cd2f1bc0f7016b34ce6433..16dda5d0203ddddf34d9ba57cd7463f0d3334327"
}
,{
"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"
}
]
},
"errors": {}
},
"filePaths": [
"select-statements.go"
],
"patch": [
"diff --git a/select-statements.go b/select-statements.go",
"index 6806fa67..79058077 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": "16dda5d0203ddddf34d9ba57cd7463f0d3334327..80d1772a3914848c3693eb725cbd0324ce54470e"
}
,{
"testCaseDescription": "go-select-statements-teardown-test",
"expectedResult": {
"changes": {
"select-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": [
"select-statements.go"
],
"patch": [
"diff --git a/select-statements.go b/select-statements.go",
"index 79058077..e69de29b 100644",
"--- a/select-statements.go",
"+++ b/select-statements.go",
"@@ -1,5 +0,0 @@",
"-package main",
"-",
"-func main() {",
"-",
"-}"
],
"gitDir": "test/corpus/repos/go",
"shas": "80d1772a3914848c3693eb725cbd0324ce54470e..70d17350ea16f4d4d0cfc2d2884ffa2d16673d76"
}]