1
1
mirror of https://github.com/github/semantic.git synced 2024-12-23 14:54:16 +03:00
semantic/test/corpus/diff-summaries/go/switch-statements.json

567 lines
19 KiB
JSON
Raw Normal View History

2016-11-02 05:05:43 +03:00
[{
2016-12-02 00:03:52 +03:00
"testCaseDescription": "go-switch-statements-setup-test",
2016-11-02 05:05:43 +03:00
"expectedResult": {
"changes": {
"switch-statements.go": [
{
"span": {
"insert": {
"start": [
2016-11-11 00:19:53 +03:00
1,
1
2016-11-02 05:05:43 +03:00
],
"end": [
2016-12-02 00:03:52 +03:00
6,
1
2016-11-02 05:05:43 +03:00
]
}
},
2016-12-02 00:03:52 +03:00
"summary": "Added the 'main' module"
2016-11-11 00:19:53 +03:00
}
]
},
"errors": {}
},
"filePaths": [
"switch-statements.go"
],
"patch": [
"diff --git a/switch-statements.go b/switch-statements.go",
2017-01-12 02:28:58 +03:00
"index e69de29..7905807 100644",
2016-11-11 00:19:53 +03:00
"--- a/switch-statements.go",
"+++ b/switch-statements.go",
2016-12-02 00:03:52 +03:00
"@@ -0,0 +1,5 @@",
"+package main",
"+",
"+func main() {",
"+",
2016-11-11 00:19:53 +03:00
"+}"
],
"gitDir": "test/corpus/repos/go",
2017-01-12 02:28:58 +03:00
"shas": "23874e933b13d7ac439111764b1ed1443d0a63b0..15b28fd75e9a0014776d787cd73d8a262c5212a7"
2016-11-11 00:19:53 +03:00
}
,{
2016-12-02 00:03:52 +03:00
"testCaseDescription": "go-switch-statements-insert-test",
2016-11-11 00:19:53 +03:00
"expectedResult": {
"changes": {
"switch-statements.go": [
2016-11-02 05:05:43 +03:00
{
"span": {
"insert": {
"start": [
4,
2016-11-11 00:19:53 +03:00
1
2016-11-02 05:05:43 +03:00
],
"end": [
2016-12-02 00:03:52 +03:00
7,
2016-11-11 00:19:53 +03:00
2
2016-11-02 05:05:43 +03:00
]
}
},
"summary": "Added a switch statement in the main function of the 'main' module"
2016-11-02 05:05:43 +03:00
}
]
},
"errors": {}
},
"filePaths": [
"switch-statements.go"
],
2016-11-11 00:19:53 +03:00
"patch": [
"diff --git a/switch-statements.go b/switch-statements.go",
2017-01-12 02:28:58 +03:00
"index 7905807..5cdd438 100644",
2016-11-11 00:19:53 +03:00
"--- a/switch-statements.go",
"+++ b/switch-statements.go",
2016-12-02 00:03:52 +03:00
"@@ -1,5 +1,8 @@",
" package main",
" ",
" func main() {",
"-",
2016-11-11 00:19:53 +03:00
"+switch { case x < y: f1()",
"+case x < z: g()",
"+case x == 4: h()",
"+}",
2016-12-02 00:03:52 +03:00
" }"
2016-11-02 05:05:43 +03:00
],
"gitDir": "test/corpus/repos/go",
2017-01-12 02:28:58 +03:00
"shas": "15b28fd75e9a0014776d787cd73d8a262c5212a7..aec1e9d87e59a95a60c0acd03d6fbc278c7b6d83"
2016-11-02 05:05:43 +03:00
}
,{
2016-12-02 00:03:52 +03:00
"testCaseDescription": "go-switch-statements-replacement-test",
2016-11-02 05:05:43 +03:00
"expectedResult": {
"changes": {
"switch-statements.go": [
{
"span": {
"replace": [
{
"start": [
2016-12-02 00:03:52 +03:00
4,
2016-11-02 05:05:43 +03:00
15
],
"end": [
2016-12-02 00:03:52 +03:00
4,
2016-11-02 05:05:43 +03:00
16
]
},
{
"start": [
2016-12-02 00:03:52 +03:00
4,
2016-11-02 05:05:43 +03:00
15
],
"end": [
2016-12-02 00:03:52 +03:00
4,
2016-11-02 05:05:43 +03:00
16
]
}
]
},
"summary": "Replaced the 'x' identifier with the 'a' identifier in a switch statement of the 'main' function"
2016-11-02 05:05:43 +03:00
},
{
"span": {
"replace": [
{
"start": [
2016-12-02 00:03:52 +03:00
4,
2016-11-02 05:05:43 +03:00
19
],
"end": [
2016-12-02 00:03:52 +03:00
4,
2016-11-02 05:05:43 +03:00
20
]
},
{
"start": [
2016-12-02 00:03:52 +03:00
4,
2016-11-02 05:05:43 +03:00
19
],
"end": [
2016-12-02 00:03:52 +03:00
4,
2016-11-02 05:05:43 +03:00
20
]
}
]
},
"summary": "Replaced the 'y' identifier with the 'b' identifier in a switch statement of the 'main' function"
2016-11-02 05:05:43 +03:00
},
{
"span": {
"replace": [
{
"start": [
2016-12-02 00:03:52 +03:00
5,
2016-11-02 05:05:43 +03:00
6
],
"end": [
2016-12-02 00:03:52 +03:00
5,
2016-11-02 05:05:43 +03:00
7
]
},
{
"start": [
2016-12-02 00:03:52 +03:00
5,
2016-11-02 05:05:43 +03:00
6
],
"end": [
2016-12-02 00:03:52 +03:00
5,
2016-11-02 05:05:43 +03:00
7
]
}
]
},
"summary": "Replaced the 'x' identifier with the 'c' identifier in a switch statement of the 'main' function"
2016-11-02 05:05:43 +03:00
},
{
"span": {
"replace": [
{
"start": [
2016-12-02 00:03:52 +03:00
5,
2016-11-02 05:05:43 +03:00
10
],
"end": [
2016-12-02 00:03:52 +03:00
5,
2016-11-02 05:05:43 +03:00
11
]
},
{
"start": [
2016-12-02 00:03:52 +03:00
5,
2016-11-02 05:05:43 +03:00
10
],
"end": [
2016-12-02 00:03:52 +03:00
5,
2016-11-02 05:05:43 +03:00
11
]
}
]
},
"summary": "Replaced the 'z' identifier with the 'd' identifier in a switch statement of the 'main' function"
2016-11-02 05:05:43 +03:00
},
{
"span": {
"replace": [
{
"start": [
2016-12-02 00:03:52 +03:00
6,
2016-11-02 05:05:43 +03:00
6
],
"end": [
2016-12-02 00:03:52 +03:00
6,
2016-11-02 05:05:43 +03:00
7
]
},
{
"start": [
2016-12-02 00:03:52 +03:00
6,
2016-11-02 05:05:43 +03:00
6
],
"end": [
2016-12-02 00:03:52 +03:00
6,
2016-11-02 05:05:43 +03:00
7
]
}
]
},
"summary": "Replaced the 'x' identifier with the 'e' identifier in a switch statement of the 'main' function"
2016-11-02 05:05:43 +03:00
},
{
"span": {
"replace": [
{
"start": [
2016-12-02 00:03:52 +03:00
6,
2016-11-02 05:05:43 +03:00
14
],
"end": [
2016-12-02 00:03:52 +03:00
6,
2016-11-02 05:05:43 +03:00
15
]
},
{
"start": [
2016-12-02 00:03:52 +03:00
6,
2016-11-02 05:05:43 +03:00
14
],
"end": [
2016-12-02 00:03:52 +03:00
6,
2016-11-02 05:05:43 +03:00
15
]
}
]
},
2016-12-02 00:03:52 +03:00
"summary": "Replaced the 'h' identifier with the 'f' identifier in the f() function call of the 'main' function"
2016-11-02 05:05:43 +03:00
}
]
},
"errors": {}
},
"filePaths": [
"switch-statements.go"
],
2016-11-11 00:19:53 +03:00
"patch": [
"diff --git a/switch-statements.go b/switch-statements.go",
2017-01-12 02:28:58 +03:00
"index 5cdd438..0b83893 100644",
2016-11-11 00:19:53 +03:00
"--- a/switch-statements.go",
"+++ b/switch-statements.go",
2016-12-02 00:03:52 +03:00
"@@ -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()",
2016-11-11 00:19:53 +03:00
" }",
2016-12-02 00:03:52 +03:00
" }"
2016-11-11 00:19:53 +03:00
],
2016-11-02 05:05:43 +03:00
"gitDir": "test/corpus/repos/go",
2017-01-12 02:28:58 +03:00
"shas": "aec1e9d87e59a95a60c0acd03d6fbc278c7b6d83..ce19396895dd7f5b4a09441f5c1ee36c5d57a544"
2016-11-02 05:05:43 +03:00
}
,{
2016-12-02 00:03:52 +03:00
"testCaseDescription": "go-switch-statements-delete-replacement-test",
2016-11-02 05:05:43 +03:00
"expectedResult": {
"changes": {
"switch-statements.go": [
{
"span": {
"replace": [
{
"start": [
2016-12-02 00:03:52 +03:00
4,
2016-11-02 05:05:43 +03:00
15
],
"end": [
2016-12-02 00:03:52 +03:00
4,
2016-11-02 05:05:43 +03:00
16
]
},
{
"start": [
2016-12-02 00:03:52 +03:00
4,
2016-11-02 05:05:43 +03:00
15
],
"end": [
2016-12-02 00:03:52 +03:00
4,
2016-11-02 05:05:43 +03:00
16
]
}
]
},
"summary": "Replaced the 'a' identifier with the 'x' identifier in a switch statement of the 'main' function"
2016-11-02 05:05:43 +03:00
},
{
"span": {
"replace": [
{
"start": [
2016-12-02 00:03:52 +03:00
4,
2016-11-02 05:05:43 +03:00
19
],
"end": [
2016-12-02 00:03:52 +03:00
4,
2016-11-02 05:05:43 +03:00
20
]
},
{
"start": [
2016-12-02 00:03:52 +03:00
4,
2016-11-02 05:05:43 +03:00
19
],
"end": [
2016-12-02 00:03:52 +03:00
4,
2016-11-02 05:05:43 +03:00
20
]
}
]
},
"summary": "Replaced the 'b' identifier with the 'y' identifier in a switch statement of the 'main' function"
2016-11-02 05:05:43 +03:00
},
{
"span": {
"replace": [
{
"start": [
2016-12-02 00:03:52 +03:00
5,
2016-11-02 05:05:43 +03:00
6
],
"end": [
2016-12-02 00:03:52 +03:00
5,
2016-11-02 05:05:43 +03:00
7
]
},
{
"start": [
2016-12-02 00:03:52 +03:00
5,
2016-11-02 05:05:43 +03:00
6
],
"end": [
2016-12-02 00:03:52 +03:00
5,
2016-11-02 05:05:43 +03:00
7
]
}
]
},
"summary": "Replaced the 'c' identifier with the 'x' identifier in a switch statement of the 'main' function"
2016-11-02 05:05:43 +03:00
},
{
"span": {
"replace": [
{
"start": [
2016-12-02 00:03:52 +03:00
5,
2016-11-02 05:05:43 +03:00
10
],
"end": [
2016-12-02 00:03:52 +03:00
5,
2016-11-02 05:05:43 +03:00
11
]
},
{
"start": [
2016-12-02 00:03:52 +03:00
5,
2016-11-02 05:05:43 +03:00
10
],
"end": [
2016-12-02 00:03:52 +03:00
5,
2016-11-02 05:05:43 +03:00
11
]
}
]
},
"summary": "Replaced the 'd' identifier with the 'z' identifier in a switch statement of the 'main' function"
2016-11-02 05:05:43 +03:00
},
{
"span": {
"replace": [
{
"start": [
2016-12-02 00:03:52 +03:00
6,
2016-11-02 05:05:43 +03:00
6
],
"end": [
2016-12-02 00:03:52 +03:00
6,
2016-11-02 05:05:43 +03:00
7
]
},
{
"start": [
2016-12-02 00:03:52 +03:00
6,
2016-11-02 05:05:43 +03:00
6
],
"end": [
2016-12-02 00:03:52 +03:00
6,
2016-11-02 05:05:43 +03:00
7
]
}
]
},
"summary": "Replaced the 'e' identifier with the 'x' identifier in a switch statement of the 'main' function"
2016-11-02 05:05:43 +03:00
},
{
"span": {
"replace": [
{
"start": [
2016-12-02 00:03:52 +03:00
6,
2016-11-02 05:05:43 +03:00
14
],
"end": [
2016-12-02 00:03:52 +03:00
6,
2016-11-02 05:05:43 +03:00
15
]
},
{
"start": [
2016-12-02 00:03:52 +03:00
6,
2016-11-02 05:05:43 +03:00
14
],
"end": [
2016-12-02 00:03:52 +03:00
6,
2016-11-02 05:05:43 +03:00
15
]
}
]
},
2016-12-02 00:03:52 +03:00
"summary": "Replaced the 'f' identifier with the 'h' identifier in the h() function call of the 'main' function"
2016-11-11 00:19:53 +03:00
}
]
},
"errors": {}
},
"filePaths": [
"switch-statements.go"
],
"patch": [
"diff --git a/switch-statements.go b/switch-statements.go",
2017-01-12 02:28:58 +03:00
"index 0b83893..5cdd438 100644",
2016-11-11 00:19:53 +03:00
"--- a/switch-statements.go",
"+++ b/switch-statements.go",
2016-12-02 00:03:52 +03:00
"@@ -1,8 +1,8 @@",
" package main",
" ",
" func main() {",
2016-11-11 00:19:53 +03:00
"-switch { case a < b: f1()",
"-case c < d: g()",
"-case e == 4: f()",
2016-12-02 00:03:52 +03:00
"+switch { case x < y: f1()",
"+case x < z: g()",
"+case x == 4: h()",
2016-11-11 00:19:53 +03:00
" }",
" }"
],
"gitDir": "test/corpus/repos/go",
2017-01-12 02:28:58 +03:00
"shas": "ce19396895dd7f5b4a09441f5c1ee36c5d57a544..97376c8d60990a1adade36011edb2951a9059579"
2016-11-11 00:19:53 +03:00
}
,{
2016-12-02 00:03:52 +03:00
"testCaseDescription": "go-switch-statements-delete-insert-test",
2016-11-11 00:19:53 +03:00
"expectedResult": {
"changes": {
"switch-statements.go": [
2016-11-02 05:05:43 +03:00
{
"span": {
"delete": {
"start": [
2016-12-02 00:03:52 +03:00
4,
2016-11-11 00:19:53 +03:00
1
2016-11-02 05:05:43 +03:00
],
"end": [
2016-12-02 00:03:52 +03:00
7,
2016-11-11 00:19:53 +03:00
2
2016-11-02 05:05:43 +03:00
]
}
},
"summary": "Deleted a switch statement in the main function of the 'main' module"
2016-11-11 00:19:53 +03:00
}
]
},
"errors": {}
},
"filePaths": [
"switch-statements.go"
],
"patch": [
"diff --git a/switch-statements.go b/switch-statements.go",
2017-01-12 02:28:58 +03:00
"index 5cdd438..7905807 100644",
2016-11-11 00:19:53 +03:00
"--- a/switch-statements.go",
"+++ b/switch-statements.go",
2016-12-02 00:03:52 +03:00
"@@ -1,8 +1,5 @@",
" package main",
" ",
" func main() {",
2016-11-11 00:19:53 +03:00
"-switch { case x < y: f1()",
"-case x < z: g()",
"-case x == 4: h()",
"-}",
2016-12-02 00:03:52 +03:00
"+",
" }"
2016-11-11 00:19:53 +03:00
],
"gitDir": "test/corpus/repos/go",
2017-01-12 02:28:58 +03:00
"shas": "97376c8d60990a1adade36011edb2951a9059579..203858d5e5dddd74b0b92ccf41c5da581c21f015"
2016-11-11 00:19:53 +03:00
}
,{
2016-12-02 00:03:52 +03:00
"testCaseDescription": "go-switch-statements-teardown-test",
2016-11-11 00:19:53 +03:00
"expectedResult": {
"changes": {
"switch-statements.go": [
2016-11-02 05:05:43 +03:00
{
"span": {
"delete": {
"start": [
2016-11-11 00:19:53 +03:00
1,
1
2016-11-02 05:05:43 +03:00
],
"end": [
2016-12-02 00:03:52 +03:00
6,
1
2016-11-02 05:05:43 +03:00
]
}
},
2016-12-02 00:03:52 +03:00
"summary": "Deleted the 'main' module"
2016-11-02 05:05:43 +03:00
}
]
},
"errors": {}
},
"filePaths": [
"switch-statements.go"
],
2016-11-11 00:19:53 +03:00
"patch": [
"diff --git a/switch-statements.go b/switch-statements.go",
2017-01-12 02:28:58 +03:00
"index 7905807..e69de29 100644",
2016-11-11 00:19:53 +03:00
"--- a/switch-statements.go",
"+++ b/switch-statements.go",
2016-12-02 00:03:52 +03:00
"@@ -1,5 +0,0 @@",
"-package main",
"-",
"-func main() {",
"-",
2016-11-11 00:19:53 +03:00
"-}"
2016-11-02 05:05:43 +03:00
],
"gitDir": "test/corpus/repos/go",
2017-01-12 02:28:58 +03:00
"shas": "203858d5e5dddd74b0b92ccf41c5da581c21f015..b3c7281ba0bf406f7e6852e6d30b0c7b2cb2fc04"
2016-11-02 05:05:43 +03:00
}]