mirror of
https://github.com/github/semantic.git
synced 2024-12-25 07:55:12 +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": "cc7734d2c90d793cab203e579a7a39270d7c10f1..edb9fba0009dc6cb137001ea77099c5a081bb7f4"
|
|
}
|
|
,{
|
|
"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": "edb9fba0009dc6cb137001ea77099c5a081bb7f4..83a0d6b29c061b1a8649288ff9838ab8f2216838"
|
|
}
|
|
,{
|
|
"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": "83a0d6b29c061b1a8649288ff9838ab8f2216838..1a4c242b069717c20b4271e8a72058d9a74b2610"
|
|
}
|
|
,{
|
|
"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": "1a4c242b069717c20b4271e8a72058d9a74b2610..97d2d7f86b62dd2c734bdf0e4c1b2f54bc8205e2"
|
|
}
|
|
,{
|
|
"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": "97d2d7f86b62dd2c734bdf0e4c1b2f54bc8205e2..05a3ee1a8662a7eb87cbdd1e288c74ba8b63c7b9"
|
|
}
|
|
,{
|
|
"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": "05a3ee1a8662a7eb87cbdd1e288c74ba8b63c7b9..ecb6ee4aa1cfd70e6c5775c60170fe04b2f6a691"
|
|
}]
|