1
1
mirror of https://github.com/github/semantic.git synced 2024-12-24 23:42:31 +03:00
semantic/test/corpus/diff-summaries/go/switch-statements.json
2016-11-21 14:39:16 -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": "c36e8a2c2f29eaffb7e46afa33aec36b90671fb3..f68e8c719073361172125edeb8e0b76f0e0e8a80"
}
,{
"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": "f68e8c719073361172125edeb8e0b76f0e0e8a80..c1f6315016c957559d3456ece2258e334fe3038f"
}
,{
"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": "c1f6315016c957559d3456ece2258e334fe3038f..8e26eff55878736cca530b81a2d47ba5e977f0a7"
}
,{
"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": "8e26eff55878736cca530b81a2d47ba5e977f0a7..2e399501ce46ddde3cd1da2e78fd074a94d8beca"
}
,{
"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": "2e399501ce46ddde3cd1da2e78fd074a94d8beca..4921d8fdb916bc218de911a98f998902c1cf3d23"
}
,{
"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": "4921d8fdb916bc218de911a98f998902c1cf3d23..70000fb86a8c4754ceeeb76ac97f5242d5bc4687"
}
,{
"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": "70000fb86a8c4754ceeeb76ac97f5242d5bc4687..b2e0de82447eb26fa111b23d6ecda9ba24b8f37f"
}]