mirror of
https://github.com/github/semantic.git
synced 2024-12-23 14:54:16 +03:00
423 lines
13 KiB
JSON
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": "a755ebf4299ae3c6e4007bbe1ed66a72657b56de..71cb67be52efa33ac5c01e3dee5c8abc88a123c5"
|
|
}
|
|
,{
|
|
"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": "71cb67be52efa33ac5c01e3dee5c8abc88a123c5..a507c0ff95abab5a6560bb3b13362859ba0f0440"
|
|
}
|
|
,{
|
|
"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": "a507c0ff95abab5a6560bb3b13362859ba0f0440..d70e58004ecee668583a499cc69740661545b5c5"
|
|
}
|
|
,{
|
|
"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": "d70e58004ecee668583a499cc69740661545b5c5..40e0f91441ccb40b4ec53cab9c47539f6f79825a"
|
|
}
|
|
,{
|
|
"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": "40e0f91441ccb40b4ec53cab9c47539f6f79825a..bf60d55e9d73d6333369abfd2e2c448a82ce011d"
|
|
}
|
|
,{
|
|
"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": "bf60d55e9d73d6333369abfd2e2c448a82ce011d..a5f852527c8fcb9cba59c33dce09153cbedc2f56"
|
|
}]
|