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/if-statements.json
2016-11-21 15:47:41 -05:00

795 lines
24 KiB
JSON

[{
"testCaseDescription": "go-if-statements-insert-test",
"expectedResult": {
"changes": {
"if-statements.go": [
{
"span": {
"insert": {
"start": [
1,
1
],
"end": [
3,
2
]
}
},
"summary": "Added the 'a()' if statement"
},
{
"span": {
"insert": {
"start": [
4,
1
],
"end": [
6,
2
]
}
},
"summary": "Added the 'a := b(); c' if statement"
},
{
"span": {
"insert": {
"start": [
7,
1
],
"end": [
11,
2
]
}
},
"summary": "Added the 'a()' if statement"
}
]
},
"errors": {}
},
"filePaths": [
"if-statements.go"
],
"patch": [
"diff --git a/if-statements.go b/if-statements.go",
"index e69de29..2266b8b 100644",
"--- a/if-statements.go",
"+++ b/if-statements.go",
"@@ -0,0 +1,11 @@",
"+if a() {",
"+b()",
"+}",
"+if a := b(); c {",
"+d()",
"+}",
"+if a() {",
"+b()",
"+} else {",
"+c()",
"+}"
],
"gitDir": "test/corpus/repos/go",
"shas": "8f1df053dc65d8af74f2d04d4da1364fc2acf9b3..4f4faa859091ae8f90f860dab9bb337bc0be5f36"
}
,{
"testCaseDescription": "go-if-statements-replacement-insert-test",
"expectedResult": {
"changes": {
"if-statements.go": [
{
"span": {
"insert": {
"start": [
1,
1
],
"end": [
3,
2
]
}
},
"summary": "Added the 'x()' if statement"
},
{
"span": {
"insert": {
"start": [
4,
1
],
"end": [
6,
2
]
}
},
"summary": "Added the 'y := b(); c' if statement"
},
{
"span": {
"insert": {
"start": [
7,
1
],
"end": [
11,
2
]
}
},
"summary": "Added the 'z()' if statement"
},
{
"span": {
"insert": {
"start": [
12,
1
],
"end": [
14,
2
]
}
},
"summary": "Added the 'a()' if statement"
},
{
"span": {
"insert": {
"start": [
15,
1
],
"end": [
17,
2
]
}
},
"summary": "Added the 'a := b(); c' if statement"
},
{
"span": {
"insert": {
"start": [
18,
1
],
"end": [
22,
2
]
}
},
"summary": "Added the 'a()' if statement"
}
]
},
"errors": {}
},
"filePaths": [
"if-statements.go"
],
"patch": [
"diff --git a/if-statements.go b/if-statements.go",
"index 2266b8b..abacd6e 100644",
"--- a/if-statements.go",
"+++ b/if-statements.go",
"@@ -1,3 +1,25 @@",
"+if x() {",
"+b()",
"+}",
"+if y := b(); c {",
"+d()",
"+}",
"+if z() {",
"+b()",
"+} else {",
"+c()",
"+}",
"+if a() {",
"+b()",
"+}",
"+if a := b(); c {",
"+d()",
"+}",
"+if a() {",
"+b()",
"+} else {",
"+c()",
"+}",
" if a() {",
" b()",
" }"
],
"gitDir": "test/corpus/repos/go",
"shas": "4f4faa859091ae8f90f860dab9bb337bc0be5f36..2be9869f41109370c9eaa0feccf68ed1c9864b6a"
}
,{
"testCaseDescription": "go-if-statements-delete-insert-test",
"expectedResult": {
"changes": {
"if-statements.go": [
{
"span": {
"replace": [
{
"start": [
1,
4
],
"end": [
1,
5
]
},
{
"start": [
1,
4
],
"end": [
1,
5
]
}
]
},
"summary": "Replaced the 'x' identifier with the 'a' identifier in the a() function call"
},
{
"span": {
"replace": [
{
"start": [
4,
4
],
"end": [
4,
5
]
},
{
"start": [
4,
4
],
"end": [
4,
5
]
}
]
},
"summary": "Replaced the 'y' identifier with the 'a' identifier in the a variable"
},
{
"span": {
"replace": [
{
"start": [
7,
4
],
"end": [
7,
5
]
},
{
"start": [
7,
4
],
"end": [
7,
5
]
}
]
},
"summary": "Replaced the 'z' identifier with the 'a' identifier in the a() function call"
}
]
},
"errors": {}
},
"filePaths": [
"if-statements.go"
],
"patch": [
"diff --git a/if-statements.go b/if-statements.go",
"index abacd6e..b5fd21a 100644",
"--- a/if-statements.go",
"+++ b/if-statements.go",
"@@ -1,10 +1,10 @@",
"-if x() {",
"+if a() {",
" b()",
" }",
"-if y := b(); c {",
"+if a := b(); c {",
" d()",
" }",
"-if z() {",
"+if a() {",
" b()",
" } else {",
" c()"
],
"gitDir": "test/corpus/repos/go",
"shas": "2be9869f41109370c9eaa0feccf68ed1c9864b6a..1448204c14a3154cead026d3deae74d27bc03675"
}
,{
"testCaseDescription": "go-if-statements-replacement-test",
"expectedResult": {
"changes": {
"if-statements.go": [
{
"span": {
"replace": [
{
"start": [
1,
4
],
"end": [
1,
5
]
},
{
"start": [
1,
4
],
"end": [
1,
5
]
}
]
},
"summary": "Replaced the 'a' identifier with the 'x' identifier in the x() function call"
},
{
"span": {
"replace": [
{
"start": [
4,
4
],
"end": [
4,
5
]
},
{
"start": [
4,
4
],
"end": [
4,
5
]
}
]
},
"summary": "Replaced the 'a' identifier with the 'y' identifier in the y variable"
},
{
"span": {
"replace": [
{
"start": [
7,
4
],
"end": [
7,
5
]
},
{
"start": [
7,
4
],
"end": [
7,
5
]
}
]
},
"summary": "Replaced the 'a' identifier with the 'z' identifier in the z() function call"
}
]
},
"errors": {}
},
"filePaths": [
"if-statements.go"
],
"patch": [
"diff --git a/if-statements.go b/if-statements.go",
"index b5fd21a..abacd6e 100644",
"--- a/if-statements.go",
"+++ b/if-statements.go",
"@@ -1,10 +1,10 @@",
"-if a() {",
"+if x() {",
" b()",
" }",
"-if a := b(); c {",
"+if y := b(); c {",
" d()",
" }",
"-if a() {",
"+if z() {",
" b()",
" } else {",
" c()"
],
"gitDir": "test/corpus/repos/go",
"shas": "1448204c14a3154cead026d3deae74d27bc03675..404b2c4aee8a4a3c179afe629cd2b68d0c877910"
}
,{
"testCaseDescription": "go-if-statements-delete-replacement-test",
"expectedResult": {
"changes": {
"if-statements.go": [
{
"span": {
"delete": {
"start": [
1,
1
],
"end": [
3,
2
]
}
},
"summary": "Deleted the 'x()' if statement"
},
{
"span": {
"delete": {
"start": [
4,
1
],
"end": [
6,
2
]
}
},
"summary": "Deleted the 'y := b(); c' if statement"
},
{
"span": {
"delete": {
"start": [
7,
1
],
"end": [
11,
2
]
}
},
"summary": "Deleted the 'z()' if statement"
},
{
"span": {
"delete": {
"start": [
12,
1
],
"end": [
14,
2
]
}
},
"summary": "Deleted the 'a()' if statement"
},
{
"span": {
"delete": {
"start": [
15,
1
],
"end": [
17,
2
]
}
},
"summary": "Deleted the 'a := b(); c' if statement"
},
{
"span": {
"delete": {
"start": [
18,
1
],
"end": [
22,
2
]
}
},
"summary": "Deleted the 'a()' if statement"
},
{
"span": {
"insert": {
"start": [
12,
1
],
"end": [
14,
2
]
}
},
"summary": "Added the 'x()' if statement"
},
{
"span": {
"insert": {
"start": [
15,
1
],
"end": [
17,
2
]
}
},
"summary": "Added the 'y := b(); c' if statement"
},
{
"span": {
"insert": {
"start": [
18,
1
],
"end": [
22,
2
]
}
},
"summary": "Added the 'z()' if statement"
}
]
},
"errors": {}
},
"filePaths": [
"if-statements.go"
],
"patch": [
"diff --git a/if-statements.go b/if-statements.go",
"index abacd6e..ccb09fd 100644",
"--- a/if-statements.go",
"+++ b/if-statements.go",
"@@ -1,14 +1,3 @@",
"-if x() {",
"-b()",
"-}",
"-if y := b(); c {",
"-d()",
"-}",
"-if z() {",
"-b()",
"-} else {",
"-c()",
"-}",
" if a() {",
" b()",
" }",
"@@ -20,13 +9,13 @@ b()",
" } else {",
" c()",
" }",
"-if a() {",
"+if x() {",
" b()",
" }",
"-if a := b(); c {",
"+if y := b(); c {",
" d()",
" }",
"-if a() {",
"+if z() {",
" b()",
" } else {",
" c()"
],
"gitDir": "test/corpus/repos/go",
"shas": "404b2c4aee8a4a3c179afe629cd2b68d0c877910..3f472c8aec702c615b21ca089e40e18a998bc244"
}
,{
"testCaseDescription": "go-if-statements-delete-test",
"expectedResult": {
"changes": {
"if-statements.go": [
{
"span": {
"delete": {
"start": [
1,
1
],
"end": [
3,
2
]
}
},
"summary": "Deleted the 'a()' if statement"
},
{
"span": {
"delete": {
"start": [
4,
1
],
"end": [
6,
2
]
}
},
"summary": "Deleted the 'a := b(); c' if statement"
},
{
"span": {
"delete": {
"start": [
7,
1
],
"end": [
11,
2
]
}
},
"summary": "Deleted the 'a()' if statement"
}
]
},
"errors": {}
},
"filePaths": [
"if-statements.go"
],
"patch": [
"diff --git a/if-statements.go b/if-statements.go",
"index ccb09fd..2e63573 100644",
"--- a/if-statements.go",
"+++ b/if-statements.go",
"@@ -1,14 +1,3 @@",
"-if a() {",
"-b()",
"-}",
"-if a := b(); c {",
"-d()",
"-}",
"-if a() {",
"-b()",
"-} else {",
"-c()",
"-}",
" if x() {",
" b()",
" }"
],
"gitDir": "test/corpus/repos/go",
"shas": "3f472c8aec702c615b21ca089e40e18a998bc244..1cff79ac340c03fe054b522d68580567504c3d08"
}
,{
"testCaseDescription": "go-if-statements-delete-rest-test",
"expectedResult": {
"changes": {
"if-statements.go": [
{
"span": {
"delete": {
"start": [
1,
1
],
"end": [
3,
2
]
}
},
"summary": "Deleted the 'x()' if statement"
},
{
"span": {
"delete": {
"start": [
4,
1
],
"end": [
6,
2
]
}
},
"summary": "Deleted the 'y := b(); c' if statement"
},
{
"span": {
"delete": {
"start": [
7,
1
],
"end": [
11,
2
]
}
},
"summary": "Deleted the 'z()' if statement"
}
]
},
"errors": {}
},
"filePaths": [
"if-statements.go"
],
"patch": [
"diff --git a/if-statements.go b/if-statements.go",
"index 2e63573..e69de29 100644",
"--- a/if-statements.go",
"+++ b/if-statements.go",
"@@ -1,11 +0,0 @@",
"-if x() {",
"-b()",
"-}",
"-if y := b(); c {",
"-d()",
"-}",
"-if z() {",
"-b()",
"-} else {",
"-c()",
"-}"
],
"gitDir": "test/corpus/repos/go",
"shas": "1cff79ac340c03fe054b522d68580567504c3d08..ab08008ff7371b63c09e12670ff74bac74bfad96"
}]