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-11-22 13:51:11 -05:00

548 lines
17 KiB
JSON

[{
"testCaseDescription": "go-select-statements-insert-test",
"expectedResult": {
"changes": {
"select-statements.go": [
{
"span": {
"insert": {
"start": [
1,
1
],
"end": [
10,
2
]
}
},
"summary": "Added a select statement"
}
]
},
"errors": {}
},
"filePaths": [
"select-statements.go"
],
"patch": [
"diff --git a/select-statements.go b/select-statements.go",
"index e69de29..7fe1c0b 100644",
"--- a/select-statements.go",
"+++ b/select-statements.go",
"@@ -0,0 +1,10 @@",
"+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": "6b240253df1166aa2ee11d564e531f38e8da8dca..a67475876d7d3c21f3ad45338fcf148a3246505a"
}
,{
"testCaseDescription": "go-select-statements-replacement-insert-test",
"expectedResult": {
"changes": {
"select-statements.go": [
{
"span": {
"insert": {
"start": [
1,
1
],
"end": [
10,
2
]
}
},
"summary": "Added a select statement"
},
{
"span": {
"insert": {
"start": [
11,
1
],
"end": [
20,
2
]
}
},
"summary": "Added a select statement"
}
]
},
"errors": {}
},
"filePaths": [
"select-statements.go"
],
"patch": [
"diff --git a/select-statements.go b/select-statements.go",
"index 7fe1c0b..1403fc7 100644",
"--- a/select-statements.go",
"+++ b/select-statements.go",
"@@ -1,4 +1,24 @@",
" select {",
"+ case a := <-c:",
"+ println(x)",
"+ case b <- c:",
"+ println(5)",
"+ case <-time.After(2):",
"+ println(6)",
"+ default:",
"+ return",
"+}",
"+select {",
"+ case x := <-c:",
"+ println(x)",
"+ case y <- c:",
"+ println(5)",
"+ case <-time.After(1):",
"+ println(6)",
"+ default:",
"+ return",
"+}",
"+select {",
" case x := <-c:",
" println(x)",
" case y <- c:"
],
"gitDir": "test/corpus/repos/go",
"shas": "a67475876d7d3c21f3ad45338fcf148a3246505a..877d77aedfbcc72add2a467e61ff6bc20966f73b"
}
,{
"testCaseDescription": "go-select-statements-delete-insert-test",
"expectedResult": {
"changes": {
"select-statements.go": [
{
"span": {
"replace": [
{
"start": [
2,
8
],
"end": [
2,
9
]
},
{
"start": [
2,
8
],
"end": [
2,
9
]
}
]
},
"summary": "Replaced the 'a' identifier with the 'x' identifier"
},
{
"span": {
"replace": [
{
"start": [
4,
8
],
"end": [
4,
9
]
},
{
"start": [
4,
8
],
"end": [
4,
9
]
}
]
},
"summary": "Replaced the 'b' identifier with the 'y' identifier"
},
{
"span": {
"replace": [
{
"start": [
6,
21
],
"end": [
6,
22
]
},
{
"start": [
6,
21
],
"end": [
6,
22
]
}
]
},
"summary": "Replaced '2' with '1'"
}
]
},
"errors": {}
},
"filePaths": [
"select-statements.go"
],
"patch": [
"diff --git a/select-statements.go b/select-statements.go",
"index 1403fc7..3e83983 100644",
"--- a/select-statements.go",
"+++ b/select-statements.go",
"@@ -1,9 +1,9 @@",
" 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": "877d77aedfbcc72add2a467e61ff6bc20966f73b..74698df366ccb6ece8715d12898b8fd2283ad628"
}
,{
"testCaseDescription": "go-select-statements-replacement-test",
"expectedResult": {
"changes": {
"select-statements.go": [
{
"span": {
"replace": [
{
"start": [
2,
8
],
"end": [
2,
9
]
},
{
"start": [
2,
8
],
"end": [
2,
9
]
}
]
},
"summary": "Replaced the 'x' identifier with the 'a' identifier"
},
{
"span": {
"replace": [
{
"start": [
4,
8
],
"end": [
4,
9
]
},
{
"start": [
4,
8
],
"end": [
4,
9
]
}
]
},
"summary": "Replaced the 'y' identifier with the 'b' identifier"
},
{
"span": {
"replace": [
{
"start": [
6,
21
],
"end": [
6,
22
]
},
{
"start": [
6,
21
],
"end": [
6,
22
]
}
]
},
"summary": "Replaced '1' with '2'"
}
]
},
"errors": {}
},
"filePaths": [
"select-statements.go"
],
"patch": [
"diff --git a/select-statements.go b/select-statements.go",
"index 3e83983..1403fc7 100644",
"--- a/select-statements.go",
"+++ b/select-statements.go",
"@@ -1,9 +1,9 @@",
" 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": "74698df366ccb6ece8715d12898b8fd2283ad628..27c1e386799c8bf96709a273228acdd81783d86c"
}
,{
"testCaseDescription": "go-select-statements-delete-replacement-test",
"expectedResult": {
"changes": {
"select-statements.go": [
{
"span": {
"delete": {
"start": [
1,
1
],
"end": [
10,
2
]
}
},
"summary": "Deleted a select statement"
},
{
"span": {
"delete": {
"start": [
11,
1
],
"end": [
20,
2
]
}
},
"summary": "Deleted a select statement"
},
{
"span": {
"insert": {
"start": [
11,
1
],
"end": [
20,
2
]
}
},
"summary": "Added a select statement"
}
]
},
"errors": {}
},
"filePaths": [
"select-statements.go"
],
"patch": [
"diff --git a/select-statements.go b/select-statements.go",
"index 1403fc7..234dd89 100644",
"--- a/select-statements.go",
"+++ b/select-statements.go",
"@@ -1,14 +1,4 @@",
" select {",
"- case a := <-c:",
"- println(x)",
"- case b <- c:",
"- println(5)",
"- case <-time.After(2):",
"- println(6)",
"- default:",
"- return",
"-}",
"-select {",
" case x := <-c:",
" println(x)",
" case y <- c:",
"@@ -19,11 +9,11 @@ select {",
" return",
" }",
" 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": "27c1e386799c8bf96709a273228acdd81783d86c..7d9d8276487f9607e28754f6c4dfcc77b6cda405"
}
,{
"testCaseDescription": "go-select-statements-delete-test",
"expectedResult": {
"changes": {
"select-statements.go": [
{
"span": {
"delete": {
"start": [
1,
1
],
"end": [
10,
2
]
}
},
"summary": "Deleted a select statement"
}
]
},
"errors": {}
},
"filePaths": [
"select-statements.go"
],
"patch": [
"diff --git a/select-statements.go b/select-statements.go",
"index 234dd89..d513030 100644",
"--- a/select-statements.go",
"+++ b/select-statements.go",
"@@ -1,14 +1,4 @@",
" select {",
"- case x := <-c:",
"- println(x)",
"- case y <- c:",
"- println(5)",
"- case <-time.After(1):",
"- println(6)",
"- default:",
"- return",
"-}",
"-select {",
" case a := <-c:",
" println(x)",
" case b <- c:"
],
"gitDir": "test/corpus/repos/go",
"shas": "7d9d8276487f9607e28754f6c4dfcc77b6cda405..0c9c335b0e6fd698bb0c75289427f0143e75e003"
}
,{
"testCaseDescription": "go-select-statements-delete-rest-test",
"expectedResult": {
"changes": {
"select-statements.go": [
{
"span": {
"delete": {
"start": [
1,
1
],
"end": [
10,
2
]
}
},
"summary": "Deleted a select statement"
}
]
},
"errors": {}
},
"filePaths": [
"select-statements.go"
],
"patch": [
"diff --git a/select-statements.go b/select-statements.go",
"index d513030..e69de29 100644",
"--- a/select-statements.go",
"+++ b/select-statements.go",
"@@ -1,10 +0,0 @@",
"-select {",
"- case a := <-c:",
"- println(x)",
"- case b <- c:",
"- println(5)",
"- case <-time.After(2):",
"- println(6)",
"- default:",
"- return",
"-}"
],
"gitDir": "test/corpus/repos/go",
"shas": "0c9c335b0e6fd698bb0c75289427f0143e75e003..3b1ccac09b42121a36dd141e3ba2c774fc257278"
}]