mirror of
https://github.com/github/semantic.git
synced 2024-12-23 23:11:50 +03:00
548 lines
17 KiB
JSON
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": "e6e28f20cc186a107a4975d3ade0fbecc2f53966..fd61c6e92760dfe4fa040e70e0cb54cf2f799604"
|
|
}
|
|
,{
|
|
"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": "fd61c6e92760dfe4fa040e70e0cb54cf2f799604..79706e568374f959a04ef90bd04436a1d84052b8"
|
|
}
|
|
,{
|
|
"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": "79706e568374f959a04ef90bd04436a1d84052b8..9079f148c2a948d113d01793beee00d27b40e2f6"
|
|
}
|
|
,{
|
|
"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": "9079f148c2a948d113d01793beee00d27b40e2f6..e66b600b4e4d53e8272c4b06a1c9bf33935bf4b5"
|
|
}
|
|
,{
|
|
"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": "e66b600b4e4d53e8272c4b06a1c9bf33935bf4b5..399d3835255510d00d5513f5b7fba7d57077599f"
|
|
}
|
|
,{
|
|
"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": "399d3835255510d00d5513f5b7fba7d57077599f..37ea2073fca4d8993478287e1af7131d66654562"
|
|
}
|
|
,{
|
|
"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": "37ea2073fca4d8993478287e1af7131d66654562..9c374c0b1b526e233253774ccd2dd4d22319c844"
|
|
}]
|