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
2016-11-14 19:12:17 -05:00

658 lines
22 KiB
JSON

[{
"testCaseDescription": "go-switch-statements-insert-test",
"expectedResult": {
"changes": {
"switch-statements.go": [
{
"span": {
"insert": {
"start": [
1,
1
],
"end": [
4,
2
]
}
},
"summary": "Added the 'branch' switch statement"
}
]
},
"errors": {}
},
"filePaths": [
"switch-statements.go"
],
"patch": [
"diff --git a/switch-statements.go b/switch-statements.go",
"index e69de29..e444d1e 100644",
"--- a/switch-statements.go",
"+++ b/switch-statements.go",
"@@ -0,0 +1,4 @@",
"+switch { case x < y: f1()",
"+case x < z: g()",
"+case x == 4: h()",
"+}"
],
"gitDir": "test/corpus/repos/go",
"shas": "ae785157f7fe1383ac01d528a3789e18ae4668c5..4426632968192496c5f56534991a4ead2cd9a047"
}
,{
"testCaseDescription": "go-switch-statements-replacement-insert-test",
"expectedResult": {
"changes": {
"switch-statements.go": [
{
"span": {
"insert": {
"start": [
1,
1
],
"end": [
4,
2
]
}
},
"summary": "Added the 'branch' switch statement"
},
{
"span": {
"insert": {
"start": [
5,
1
],
"end": [
8,
2
]
}
},
"summary": "Added the 'branch' switch statement"
}
]
},
"errors": {}
},
"filePaths": [
"switch-statements.go"
],
"patch": [
"diff --git a/switch-statements.go b/switch-statements.go",
"index e444d1e..e2e5cf3 100644",
"--- a/switch-statements.go",
"+++ b/switch-statements.go",
"@@ -1,3 +1,11 @@",
"+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()",
"+}",
" switch { case x < y: f1()",
" case x < z: g()",
" case x == 4: h()"
],
"gitDir": "test/corpus/repos/go",
"shas": "4426632968192496c5f56534991a4ead2cd9a047..7a969b9cee44686b6eda803a48ba88993d81aa18"
}
,{
"testCaseDescription": "go-switch-statements-delete-insert-test",
"expectedResult": {
"changes": {
"switch-statements.go": [
{
"span": {
"replace": [
{
"start": [
1,
15
],
"end": [
1,
16
]
},
{
"start": [
1,
15
],
"end": [
1,
16
]
}
]
},
"summary": "Replaced the 'a' identifier with the 'x' identifier in the 'branch' switch statement"
},
{
"span": {
"replace": [
{
"start": [
1,
19
],
"end": [
1,
20
]
},
{
"start": [
1,
19
],
"end": [
1,
20
]
}
]
},
"summary": "Replaced the 'b' identifier with the 'y' identifier in the 'branch' switch statement"
},
{
"span": {
"replace": [
{
"start": [
2,
6
],
"end": [
2,
7
]
},
{
"start": [
2,
6
],
"end": [
2,
7
]
}
]
},
"summary": "Replaced the 'c' identifier with the 'x' identifier in the 'branch' switch statement"
},
{
"span": {
"replace": [
{
"start": [
2,
10
],
"end": [
2,
11
]
},
{
"start": [
2,
10
],
"end": [
2,
11
]
}
]
},
"summary": "Replaced the 'd' identifier with the 'z' identifier in the 'branch' switch statement"
},
{
"span": {
"replace": [
{
"start": [
3,
6
],
"end": [
3,
7
]
},
{
"start": [
3,
6
],
"end": [
3,
7
]
}
]
},
"summary": "Replaced the 'e' identifier with the 'x' identifier in the 'branch' switch statement"
},
{
"span": {
"replace": [
{
"start": [
3,
14
],
"end": [
3,
15
]
},
{
"start": [
3,
14
],
"end": [
3,
15
]
}
]
},
"summary": "Replaced the 'f' identifier with the 'h' identifier in the h() function call"
}
]
},
"errors": {}
},
"filePaths": [
"switch-statements.go"
],
"patch": [
"diff --git a/switch-statements.go b/switch-statements.go",
"index e2e5cf3..143707d 100644",
"--- a/switch-statements.go",
"+++ b/switch-statements.go",
"@@ -1,6 +1,6 @@",
"-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()",
" }",
" switch { case x < y: f1()",
" case x < z: g()"
],
"gitDir": "test/corpus/repos/go",
"shas": "7a969b9cee44686b6eda803a48ba88993d81aa18..41483d89379d5b52359776abe6906fe5e1251ac6"
}
,{
"testCaseDescription": "go-switch-statements-replacement-test",
"expectedResult": {
"changes": {
"switch-statements.go": [
{
"span": {
"replace": [
{
"start": [
1,
15
],
"end": [
1,
16
]
},
{
"start": [
1,
15
],
"end": [
1,
16
]
}
]
},
"summary": "Replaced the 'x' identifier with the 'a' identifier in the 'branch' switch statement"
},
{
"span": {
"replace": [
{
"start": [
1,
19
],
"end": [
1,
20
]
},
{
"start": [
1,
19
],
"end": [
1,
20
]
}
]
},
"summary": "Replaced the 'y' identifier with the 'b' identifier in the 'branch' switch statement"
},
{
"span": {
"replace": [
{
"start": [
2,
6
],
"end": [
2,
7
]
},
{
"start": [
2,
6
],
"end": [
2,
7
]
}
]
},
"summary": "Replaced the 'x' identifier with the 'c' identifier in the 'branch' switch statement"
},
{
"span": {
"replace": [
{
"start": [
2,
10
],
"end": [
2,
11
]
},
{
"start": [
2,
10
],
"end": [
2,
11
]
}
]
},
"summary": "Replaced the 'z' identifier with the 'd' identifier in the 'branch' switch statement"
},
{
"span": {
"replace": [
{
"start": [
3,
6
],
"end": [
3,
7
]
},
{
"start": [
3,
6
],
"end": [
3,
7
]
}
]
},
"summary": "Replaced the 'x' identifier with the 'e' identifier in the 'branch' switch statement"
},
{
"span": {
"replace": [
{
"start": [
3,
14
],
"end": [
3,
15
]
},
{
"start": [
3,
14
],
"end": [
3,
15
]
}
]
},
"summary": "Replaced the 'h' identifier with the 'f' identifier in the f() function call"
}
]
},
"errors": {}
},
"filePaths": [
"switch-statements.go"
],
"patch": [
"diff --git a/switch-statements.go b/switch-statements.go",
"index 143707d..e2e5cf3 100644",
"--- a/switch-statements.go",
"+++ b/switch-statements.go",
"@@ -1,6 +1,6 @@",
"-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()",
" }",
" switch { case x < y: f1()",
" case x < z: g()"
],
"gitDir": "test/corpus/repos/go",
"shas": "41483d89379d5b52359776abe6906fe5e1251ac6..fcbf90b5ddf6265a21e379b9b20b7fce025b08b3"
}
,{
"testCaseDescription": "go-switch-statements-delete-replacement-test",
"expectedResult": {
"changes": {
"switch-statements.go": [
{
"span": {
"delete": {
"start": [
1,
1
],
"end": [
4,
2
]
}
},
"summary": "Deleted the 'branch' switch statement"
},
{
"span": {
"delete": {
"start": [
5,
1
],
"end": [
8,
2
]
}
},
"summary": "Deleted the 'branch' switch statement"
},
{
"span": {
"insert": {
"start": [
5,
1
],
"end": [
8,
2
]
}
},
"summary": "Added the 'branch' switch statement"
}
]
},
"errors": {}
},
"filePaths": [
"switch-statements.go"
],
"patch": [
"diff --git a/switch-statements.go b/switch-statements.go",
"index e2e5cf3..6989d28 100644",
"--- a/switch-statements.go",
"+++ b/switch-statements.go",
"@@ -1,12 +1,8 @@",
"-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()",
" }",
"-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": "fcbf90b5ddf6265a21e379b9b20b7fce025b08b3..9b21930b112789cab2ad8d4a622dc5cb606c2a87"
}
,{
"testCaseDescription": "go-switch-statements-delete-test",
"expectedResult": {
"changes": {
"switch-statements.go": [
{
"span": {
"delete": {
"start": [
1,
1
],
"end": [
4,
2
]
}
},
"summary": "Deleted the 'branch' switch statement"
}
]
},
"errors": {}
},
"filePaths": [
"switch-statements.go"
],
"patch": [
"diff --git a/switch-statements.go b/switch-statements.go",
"index 6989d28..eff174f 100644",
"--- a/switch-statements.go",
"+++ b/switch-statements.go",
"@@ -1,7 +1,3 @@",
"-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": "9b21930b112789cab2ad8d4a622dc5cb606c2a87..59a7466f38baada5a74c8b875a73c49292899963"
}
,{
"testCaseDescription": "go-switch-statements-delete-rest-test",
"expectedResult": {
"changes": {
"switch-statements.go": [
{
"span": {
"delete": {
"start": [
1,
1
],
"end": [
4,
2
]
}
},
"summary": "Deleted the 'branch' switch statement"
}
]
},
"errors": {}
},
"filePaths": [
"switch-statements.go"
],
"patch": [
"diff --git a/switch-statements.go b/switch-statements.go",
"index eff174f..e69de29 100644",
"--- a/switch-statements.go",
"+++ b/switch-statements.go",
"@@ -1,4 +0,0 @@",
"-switch { case a < b: f1()",
"-case c < d: g()",
"-case e == 4: f()",
"-}"
],
"gitDir": "test/corpus/repos/go",
"shas": "59a7466f38baada5a74c8b875a73c49292899963..a8155b8557e5b1e3f1f329162ee43e09c4c32fdf"
}]