mirror of
https://github.com/github/semantic.git
synced 2024-12-23 14:54:16 +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": "ac6b6bbe58af4dc4d3df8ac6d8c4eb8c0ff96956..85f8e46889193ba77759e827aaeee364946170c4"
|
|
}
|
|
,{
|
|
"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": "85f8e46889193ba77759e827aaeee364946170c4..17d3b27df41cbcec67c9affd712f2e7c571c478e"
|
|
}
|
|
,{
|
|
"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": "17d3b27df41cbcec67c9affd712f2e7c571c478e..df748d8d8df3172379568de0d101eca643f8ca33"
|
|
}
|
|
,{
|
|
"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": "df748d8d8df3172379568de0d101eca643f8ca33..fd62918a1723e54539b6280ab48bd648718dab7e"
|
|
}
|
|
,{
|
|
"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": "fd62918a1723e54539b6280ab48bd648718dab7e..2752591b3307c629727d0c0aaf7d66af198e64e6"
|
|
}
|
|
,{
|
|
"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": "2752591b3307c629727d0c0aaf7d66af198e64e6..c4abcf3056906df57e9b43eceabffaffa29d3d6d"
|
|
}
|
|
,{
|
|
"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": "c4abcf3056906df57e9b43eceabffaffa29d3d6d..430f150040921e52f446cf12075666fac38a5dae"
|
|
}]
|