mirror of
https://github.com/github/semantic.git
synced 2024-12-23 14:54:16 +03:00
567 lines
19 KiB
JSON
567 lines
19 KiB
JSON
[{
|
|
"testCaseDescription": "go-switch-statements-setup-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"switch-statements.go": [
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
6,
|
|
1
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'main' module"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"switch-statements.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/switch-statements.go b/switch-statements.go",
|
|
"index e69de29..7905807 100644",
|
|
"--- a/switch-statements.go",
|
|
"+++ b/switch-statements.go",
|
|
"@@ -0,0 +1,5 @@",
|
|
"+package main",
|
|
"+",
|
|
"+func main() {",
|
|
"+",
|
|
"+}"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "d2e1a6ae892f759aae12fe788f47d9908e1640f8..2462d4a68846a59d46874870d617e4598a954b40"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-switch-statements-insert-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"switch-statements.go": [
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
4,
|
|
1
|
|
],
|
|
"end": [
|
|
7,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'branch' switch statement in the main function of the 'main' module"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"switch-statements.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/switch-statements.go b/switch-statements.go",
|
|
"index 7905807..5cdd438 100644",
|
|
"--- a/switch-statements.go",
|
|
"+++ b/switch-statements.go",
|
|
"@@ -1,5 +1,8 @@",
|
|
" package main",
|
|
" ",
|
|
" func main() {",
|
|
"-",
|
|
"+switch { case x < y: f1()",
|
|
"+case x < z: g()",
|
|
"+case x == 4: h()",
|
|
"+}",
|
|
" }"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "2462d4a68846a59d46874870d617e4598a954b40..4c0f714730e69420b3effad2a132532df7f7dc3d"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-switch-statements-replacement-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"switch-statements.go": [
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
4,
|
|
15
|
|
],
|
|
"end": [
|
|
4,
|
|
16
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
4,
|
|
15
|
|
],
|
|
"end": [
|
|
4,
|
|
16
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'x' identifier with the 'a' identifier in the 'branch' switch statement of the 'main' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
4,
|
|
19
|
|
],
|
|
"end": [
|
|
4,
|
|
20
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
4,
|
|
19
|
|
],
|
|
"end": [
|
|
4,
|
|
20
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'y' identifier with the 'b' identifier in the 'branch' switch statement of the 'main' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
5,
|
|
6
|
|
],
|
|
"end": [
|
|
5,
|
|
7
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
5,
|
|
6
|
|
],
|
|
"end": [
|
|
5,
|
|
7
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'x' identifier with the 'c' identifier in the 'branch' switch statement of the 'main' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
5,
|
|
10
|
|
],
|
|
"end": [
|
|
5,
|
|
11
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
5,
|
|
10
|
|
],
|
|
"end": [
|
|
5,
|
|
11
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'z' identifier with the 'd' identifier in the 'branch' switch statement of the 'main' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
6,
|
|
6
|
|
],
|
|
"end": [
|
|
6,
|
|
7
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
6,
|
|
6
|
|
],
|
|
"end": [
|
|
6,
|
|
7
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'x' identifier with the 'e' identifier in the 'branch' switch statement of the 'main' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
6,
|
|
14
|
|
],
|
|
"end": [
|
|
6,
|
|
15
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
6,
|
|
14
|
|
],
|
|
"end": [
|
|
6,
|
|
15
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'h' identifier with the 'f' identifier in the f() function call of the 'main' function"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"switch-statements.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/switch-statements.go b/switch-statements.go",
|
|
"index 5cdd438..0b83893 100644",
|
|
"--- a/switch-statements.go",
|
|
"+++ b/switch-statements.go",
|
|
"@@ -1,8 +1,8 @@",
|
|
" package main",
|
|
" ",
|
|
" func main() {",
|
|
"-switch { case x < y: f1()",
|
|
"-case x < z: g()",
|
|
"-case x == 4: h()",
|
|
"+switch { case a < b: f1()",
|
|
"+case c < d: g()",
|
|
"+case e == 4: f()",
|
|
" }",
|
|
" }"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "4c0f714730e69420b3effad2a132532df7f7dc3d..4a4d79d1d978f1c4bf77f165777093ecd633d2d3"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-switch-statements-delete-replacement-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"switch-statements.go": [
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
4,
|
|
15
|
|
],
|
|
"end": [
|
|
4,
|
|
16
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
4,
|
|
15
|
|
],
|
|
"end": [
|
|
4,
|
|
16
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'a' identifier with the 'x' identifier in the 'branch' switch statement of the 'main' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
4,
|
|
19
|
|
],
|
|
"end": [
|
|
4,
|
|
20
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
4,
|
|
19
|
|
],
|
|
"end": [
|
|
4,
|
|
20
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'b' identifier with the 'y' identifier in the 'branch' switch statement of the 'main' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
5,
|
|
6
|
|
],
|
|
"end": [
|
|
5,
|
|
7
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
5,
|
|
6
|
|
],
|
|
"end": [
|
|
5,
|
|
7
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'c' identifier with the 'x' identifier in the 'branch' switch statement of the 'main' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
5,
|
|
10
|
|
],
|
|
"end": [
|
|
5,
|
|
11
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
5,
|
|
10
|
|
],
|
|
"end": [
|
|
5,
|
|
11
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'd' identifier with the 'z' identifier in the 'branch' switch statement of the 'main' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
6,
|
|
6
|
|
],
|
|
"end": [
|
|
6,
|
|
7
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
6,
|
|
6
|
|
],
|
|
"end": [
|
|
6,
|
|
7
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'e' identifier with the 'x' identifier in the 'branch' switch statement of the 'main' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
6,
|
|
14
|
|
],
|
|
"end": [
|
|
6,
|
|
15
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
6,
|
|
14
|
|
],
|
|
"end": [
|
|
6,
|
|
15
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'f' identifier with the 'h' identifier in the h() function call of the 'main' function"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"switch-statements.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/switch-statements.go b/switch-statements.go",
|
|
"index 0b83893..5cdd438 100644",
|
|
"--- a/switch-statements.go",
|
|
"+++ b/switch-statements.go",
|
|
"@@ -1,8 +1,8 @@",
|
|
" package main",
|
|
" ",
|
|
" func main() {",
|
|
"-switch { case a < b: f1()",
|
|
"-case c < d: g()",
|
|
"-case e == 4: f()",
|
|
"+switch { case x < y: f1()",
|
|
"+case x < z: g()",
|
|
"+case x == 4: h()",
|
|
" }",
|
|
" }"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "4a4d79d1d978f1c4bf77f165777093ecd633d2d3..6fd0a99a79a03eb035e79c923d3358e5be09ab02"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-switch-statements-delete-insert-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"switch-statements.go": [
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
4,
|
|
1
|
|
],
|
|
"end": [
|
|
7,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'branch' switch statement in the main function of the 'main' module"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"switch-statements.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/switch-statements.go b/switch-statements.go",
|
|
"index 5cdd438..7905807 100644",
|
|
"--- a/switch-statements.go",
|
|
"+++ b/switch-statements.go",
|
|
"@@ -1,8 +1,5 @@",
|
|
" package main",
|
|
" ",
|
|
" func main() {",
|
|
"-switch { case x < y: f1()",
|
|
"-case x < z: g()",
|
|
"-case x == 4: h()",
|
|
"-}",
|
|
"+",
|
|
" }"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "6fd0a99a79a03eb035e79c923d3358e5be09ab02..8688912045fbde57abc1c51d8f90b6eca62bb32b"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-switch-statements-teardown-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"switch-statements.go": [
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
6,
|
|
1
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'main' module"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"switch-statements.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/switch-statements.go b/switch-statements.go",
|
|
"index 7905807..e69de29 100644",
|
|
"--- a/switch-statements.go",
|
|
"+++ b/switch-statements.go",
|
|
"@@ -1,5 +0,0 @@",
|
|
"-package main",
|
|
"-",
|
|
"-func main() {",
|
|
"-",
|
|
"-}"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "8688912045fbde57abc1c51d8f90b6eca62bb32b..efba8e172e8e3432767b96c343de5c18fcf85810"
|
|
}]
|