1
1
mirror of https://github.com/github/semantic.git synced 2024-12-26 00:12:29 +03:00
semantic/test/corpus/diff-summaries/go/if-statements.json

795 lines
24 KiB
JSON
Raw Normal View History

2016-11-02 21:37:30 +03:00
[{
"testCaseDescription": "go-if-statements-insert-test",
"expectedResult": {
"changes": {
"if-statements.go": [
{
"span": {
2016-11-11 00:19:53 +03:00
"insert": {
"start": [
1,
1
],
"end": [
3,
2
]
}
},
"summary": "Added the 'a()' if statement"
},
{
"span": {
"insert": {
"start": [
4,
1
],
"end": [
6,
2
]
}
2016-11-02 21:37:30 +03:00
},
2016-11-11 00:19:53 +03:00
"summary": "Added the 'a := b(); c' if statement"
},
{
"span": {
"insert": {
"start": [
7,
1
],
"end": [
11,
2
]
}
},
"summary": "Added the 'a()' if statement"
2016-11-02 21:37:30 +03:00
}
]
},
"errors": {}
},
"filePaths": [
"if-statements.go"
],
2016-11-11 00:19:53 +03:00
"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()",
"+}"
],
2016-11-02 21:37:30 +03:00
"gitDir": "test/corpus/repos/go",
"shas": "e5f2f2236940b08d388cf2d1ceb0263e263190a0..8af7b7bb32976bb915495bddf809687e35e64a62"
2016-11-02 21:37:30 +03:00
}
,{
"testCaseDescription": "go-if-statements-replacement-insert-test",
"expectedResult": {
"changes": {
"if-statements.go": [
{
"span": {
"insert": {
"start": [
2016-11-11 00:19:53 +03:00
1,
2016-11-02 21:37:30 +03:00
1
],
"end": [
2016-11-11 00:19:53 +03:00
3,
2016-11-03 01:09:32 +03:00
2
2016-11-02 21:37:30 +03:00
]
}
},
2016-11-03 01:09:32 +03:00
"summary": "Added the 'x()' if statement"
2016-11-02 21:37:30 +03:00
},
{
"span": {
"insert": {
"start": [
2016-11-11 00:19:53 +03:00
4,
2016-11-02 21:37:30 +03:00
1
],
"end": [
2016-11-11 00:19:53 +03:00
6,
2016-11-03 01:09:32 +03:00
2
2016-11-02 21:37:30 +03:00
]
}
},
2016-11-03 01:09:32 +03:00
"summary": "Added the 'y := b(); c' if statement"
2016-11-02 21:37:30 +03:00
},
{
"span": {
"insert": {
"start": [
2016-11-11 00:19:53 +03:00
7,
2016-11-02 21:37:30 +03:00
1
],
"end": [
2016-11-11 00:19:53 +03:00
11,
2016-11-03 01:09:32 +03:00
2
2016-11-02 21:37:30 +03:00
]
}
},
2016-11-03 01:09:32 +03:00
"summary": "Added the 'z()' if statement"
2016-11-02 21:37:30 +03:00
},
{
"span": {
"insert": {
"start": [
2016-11-11 00:19:53 +03:00
12,
2016-11-02 21:37:30 +03:00
1
],
"end": [
2016-11-11 00:19:53 +03:00
14,
2016-11-03 01:09:32 +03:00
2
2016-11-02 21:37:30 +03:00
]
}
},
2016-11-03 01:09:32 +03:00
"summary": "Added the 'a()' if statement"
2016-11-02 21:37:30 +03:00
},
{
"span": {
"insert": {
"start": [
2016-11-11 00:19:53 +03:00
15,
2016-11-02 21:37:30 +03:00
1
],
"end": [
2016-11-11 00:19:53 +03:00
17,
2016-11-03 01:09:32 +03:00
2
2016-11-02 21:37:30 +03:00
]
}
},
2016-11-03 01:09:32 +03:00
"summary": "Added the 'a := b(); c' if statement"
2016-11-02 21:37:30 +03:00
},
{
"span": {
"insert": {
"start": [
2016-11-11 00:19:53 +03:00
18,
2016-11-02 21:37:30 +03:00
1
],
"end": [
2016-11-11 00:19:53 +03:00
22,
2016-11-03 01:09:32 +03:00
2
2016-11-02 21:37:30 +03:00
]
}
},
2016-11-03 01:09:32 +03:00
"summary": "Added the 'a()' if statement"
2016-11-02 21:37:30 +03:00
}
]
},
"errors": {}
},
"filePaths": [
"if-statements.go"
],
2016-11-11 00:19:53 +03:00
"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()",
" }"
],
2016-11-02 21:37:30 +03:00
"gitDir": "test/corpus/repos/go",
"shas": "8af7b7bb32976bb915495bddf809687e35e64a62..ee43d0d931d3d732acc57c108486fb92ce7751c9"
2016-11-02 21:37:30 +03:00
}
,{
"testCaseDescription": "go-if-statements-delete-insert-test",
"expectedResult": {
"changes": {
"if-statements.go": [
{
"span": {
"replace": [
{
"start": [
2016-11-11 00:19:53 +03:00
1,
2016-11-02 21:37:30 +03:00
4
],
"end": [
2016-11-11 00:19:53 +03:00
1,
2016-11-02 21:37:30 +03:00
5
]
},
{
"start": [
2016-11-11 00:19:53 +03:00
1,
2016-11-02 21:37:30 +03:00
4
],
"end": [
2016-11-11 00:19:53 +03:00
1,
2016-11-02 21:37:30 +03:00
5
]
}
]
},
"summary": "Replaced the 'x' identifier with the 'a' identifier in the a() function call"
},
{
"span": {
"replace": [
{
"start": [
2016-11-11 00:19:53 +03:00
4,
2016-11-02 21:37:30 +03:00
4
],
"end": [
2016-11-11 00:19:53 +03:00
4,
2016-11-02 21:37:30 +03:00
5
]
},
{
"start": [
2016-11-11 00:19:53 +03:00
4,
2016-11-02 21:37:30 +03:00
4
],
"end": [
2016-11-11 00:19:53 +03:00
4,
2016-11-02 21:37:30 +03:00
5
]
}
]
},
2016-11-02 23:46:17 +03:00
"summary": "Replaced the 'y' identifier with the 'a' identifier in the a variable"
2016-11-02 21:37:30 +03:00
},
{
"span": {
"replace": [
{
"start": [
2016-11-11 00:19:53 +03:00
7,
2016-11-02 21:37:30 +03:00
4
],
"end": [
2016-11-11 00:19:53 +03:00
7,
2016-11-02 21:37:30 +03:00
5
]
},
{
"start": [
2016-11-11 00:19:53 +03:00
7,
2016-11-02 21:37:30 +03:00
4
],
"end": [
2016-11-11 00:19:53 +03:00
7,
2016-11-02 21:37:30 +03:00
5
]
}
]
},
"summary": "Replaced the 'z' identifier with the 'a' identifier in the a() function call"
}
]
},
"errors": {}
},
"filePaths": [
"if-statements.go"
],
2016-11-11 00:19:53 +03:00
"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()"
],
2016-11-02 21:37:30 +03:00
"gitDir": "test/corpus/repos/go",
"shas": "ee43d0d931d3d732acc57c108486fb92ce7751c9..1d69053490ba50069abc622702098b527a893249"
2016-11-02 21:37:30 +03:00
}
,{
"testCaseDescription": "go-if-statements-replacement-test",
"expectedResult": {
"changes": {
"if-statements.go": [
{
"span": {
"replace": [
{
"start": [
2016-11-11 00:19:53 +03:00
1,
2016-11-02 21:37:30 +03:00
4
],
"end": [
2016-11-11 00:19:53 +03:00
1,
2016-11-02 21:37:30 +03:00
5
]
},
{
"start": [
2016-11-11 00:19:53 +03:00
1,
2016-11-02 21:37:30 +03:00
4
],
"end": [
2016-11-11 00:19:53 +03:00
1,
2016-11-02 21:37:30 +03:00
5
]
}
]
},
"summary": "Replaced the 'a' identifier with the 'x' identifier in the x() function call"
},
{
"span": {
"replace": [
{
"start": [
2016-11-11 00:19:53 +03:00
4,
2016-11-02 21:37:30 +03:00
4
],
"end": [
2016-11-11 00:19:53 +03:00
4,
2016-11-02 21:37:30 +03:00
5
]
},
{
"start": [
2016-11-11 00:19:53 +03:00
4,
2016-11-02 21:37:30 +03:00
4
],
"end": [
2016-11-11 00:19:53 +03:00
4,
2016-11-02 21:37:30 +03:00
5
]
}
]
},
2016-11-02 23:46:17 +03:00
"summary": "Replaced the 'a' identifier with the 'y' identifier in the y variable"
2016-11-02 21:37:30 +03:00
},
{
"span": {
"replace": [
{
"start": [
2016-11-11 00:19:53 +03:00
7,
2016-11-02 21:37:30 +03:00
4
],
"end": [
2016-11-11 00:19:53 +03:00
7,
2016-11-02 21:37:30 +03:00
5
]
},
{
"start": [
2016-11-11 00:19:53 +03:00
7,
2016-11-02 21:37:30 +03:00
4
],
"end": [
2016-11-11 00:19:53 +03:00
7,
2016-11-02 21:37:30 +03:00
5
]
}
]
},
"summary": "Replaced the 'a' identifier with the 'z' identifier in the z() function call"
}
]
},
"errors": {}
},
"filePaths": [
"if-statements.go"
],
2016-11-11 00:19:53 +03:00
"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()"
],
2016-11-02 21:37:30 +03:00
"gitDir": "test/corpus/repos/go",
"shas": "1d69053490ba50069abc622702098b527a893249..d9e3f39d9aef15166414e52b90e3460d4e2861e6"
2016-11-02 21:37:30 +03:00
}
,{
"testCaseDescription": "go-if-statements-delete-replacement-test",
"expectedResult": {
"changes": {
"if-statements.go": [
{
"span": {
"delete": {
"start": [
2016-11-11 00:19:53 +03:00
1,
2016-11-02 21:37:30 +03:00
1
],
"end": [
2016-11-11 00:19:53 +03:00
3,
2016-11-03 01:09:32 +03:00
2
2016-11-02 21:37:30 +03:00
]
}
},
2016-11-03 01:09:32 +03:00
"summary": "Deleted the 'x()' if statement"
2016-11-02 21:37:30 +03:00
},
{
"span": {
"delete": {
"start": [
2016-11-11 00:19:53 +03:00
4,
2016-11-02 21:37:30 +03:00
1
],
"end": [
2016-11-11 00:19:53 +03:00
6,
2016-11-03 01:09:32 +03:00
2
2016-11-02 21:37:30 +03:00
]
}
},
2016-11-03 01:09:32 +03:00
"summary": "Deleted the 'y := b(); c' if statement"
2016-11-02 21:37:30 +03:00
},
{
"span": {
"delete": {
"start": [
2016-11-11 00:19:53 +03:00
7,
2016-11-02 21:37:30 +03:00
1
],
"end": [
2016-11-11 00:19:53 +03:00
11,
2016-11-03 01:09:32 +03:00
2
2016-11-02 21:37:30 +03:00
]
}
},
2016-11-03 01:09:32 +03:00
"summary": "Deleted the 'z()' if statement"
2016-11-02 21:37:30 +03:00
},
{
"span": {
"delete": {
"start": [
2016-11-11 00:19:53 +03:00
12,
2016-11-02 21:37:30 +03:00
1
],
"end": [
2016-11-11 00:19:53 +03:00
14,
2016-11-03 01:09:32 +03:00
2
2016-11-02 21:37:30 +03:00
]
}
},
2016-11-03 01:09:32 +03:00
"summary": "Deleted the 'a()' if statement"
2016-11-02 21:37:30 +03:00
},
{
"span": {
"delete": {
"start": [
2016-11-11 00:19:53 +03:00
15,
2016-11-02 21:37:30 +03:00
1
],
"end": [
2016-11-11 00:19:53 +03:00
17,
2016-11-03 01:09:32 +03:00
2
2016-11-02 21:37:30 +03:00
]
}
},
2016-11-03 01:09:32 +03:00
"summary": "Deleted the 'a := b(); c' if statement"
2016-11-02 21:37:30 +03:00
},
{
"span": {
"delete": {
"start": [
2016-11-11 00:19:53 +03:00
18,
2016-11-02 21:37:30 +03:00
1
],
"end": [
2016-11-11 00:19:53 +03:00
22,
2016-11-03 01:09:32 +03:00
2
2016-11-02 21:37:30 +03:00
]
}
},
2016-11-03 01:09:32 +03:00
"summary": "Deleted the 'a()' if statement"
2016-11-02 21:37:30 +03:00
},
{
"span": {
"insert": {
"start": [
2016-11-11 00:19:53 +03:00
12,
2016-11-02 21:37:30 +03:00
1
],
"end": [
2016-11-11 00:19:53 +03:00
14,
2016-11-03 01:09:32 +03:00
2
2016-11-02 21:37:30 +03:00
]
}
},
2016-11-03 01:09:32 +03:00
"summary": "Added the 'x()' if statement"
2016-11-02 21:37:30 +03:00
},
{
"span": {
"insert": {
"start": [
2016-11-11 00:19:53 +03:00
15,
2016-11-02 21:37:30 +03:00
1
],
"end": [
2016-11-11 00:19:53 +03:00
17,
2016-11-03 01:09:32 +03:00
2
2016-11-02 21:37:30 +03:00
]
}
},
2016-11-03 01:09:32 +03:00
"summary": "Added the 'y := b(); c' if statement"
2016-11-02 21:37:30 +03:00
},
{
"span": {
"insert": {
"start": [
2016-11-11 00:19:53 +03:00
18,
2016-11-02 21:37:30 +03:00
1
],
"end": [
2016-11-11 00:19:53 +03:00
22,
2016-11-03 01:09:32 +03:00
2
2016-11-02 21:37:30 +03:00
]
}
},
2016-11-03 01:09:32 +03:00
"summary": "Added the 'z()' if statement"
2016-11-02 21:37:30 +03:00
}
]
},
"errors": {}
},
"filePaths": [
"if-statements.go"
],
2016-11-11 00:19:53 +03:00
"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()"
],
2016-11-02 21:37:30 +03:00
"gitDir": "test/corpus/repos/go",
"shas": "d9e3f39d9aef15166414e52b90e3460d4e2861e6..e526833ebbe2fdfddd44ff296aa341c62fa1a40c"
2016-11-02 21:37:30 +03:00
}
,{
"testCaseDescription": "go-if-statements-delete-test",
"expectedResult": {
"changes": {
"if-statements.go": [
{
"span": {
"delete": {
"start": [
2016-11-11 00:19:53 +03:00
1,
2016-11-02 21:37:30 +03:00
1
],
"end": [
2016-11-11 00:19:53 +03:00
3,
2016-11-03 01:09:32 +03:00
2
2016-11-02 21:37:30 +03:00
]
}
},
2016-11-03 01:09:32 +03:00
"summary": "Deleted the 'a()' if statement"
2016-11-02 21:37:30 +03:00
},
{
"span": {
"delete": {
"start": [
2016-11-11 00:19:53 +03:00
4,
2016-11-02 21:37:30 +03:00
1
],
"end": [
2016-11-11 00:19:53 +03:00
6,
2016-11-03 01:09:32 +03:00
2
2016-11-02 21:37:30 +03:00
]
}
},
2016-11-03 01:09:32 +03:00
"summary": "Deleted the 'a := b(); c' if statement"
2016-11-02 21:37:30 +03:00
},
{
"span": {
"delete": {
"start": [
2016-11-11 00:19:53 +03:00
7,
2016-11-02 21:37:30 +03:00
1
],
"end": [
2016-11-11 00:19:53 +03:00
11,
2016-11-03 01:09:32 +03:00
2
2016-11-02 21:37:30 +03:00
]
}
},
2016-11-03 01:09:32 +03:00
"summary": "Deleted the 'a()' if statement"
2016-11-02 21:37:30 +03:00
}
]
},
"errors": {}
},
"filePaths": [
"if-statements.go"
],
2016-11-11 00:19:53 +03:00
"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()",
" }"
],
2016-11-02 21:37:30 +03:00
"gitDir": "test/corpus/repos/go",
"shas": "e526833ebbe2fdfddd44ff296aa341c62fa1a40c..da3e038ea5de3df0e12be8da86fc27d03b9b9a78"
2016-11-02 21:37:30 +03:00
}
,{
"testCaseDescription": "go-if-statements-delete-rest-test",
"expectedResult": {
"changes": {
"if-statements.go": [
{
"span": {
2016-11-11 00:19:53 +03:00
"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
]
}
2016-11-02 21:37:30 +03:00
},
2016-11-11 00:19:53 +03:00
"summary": "Deleted the 'z()' if statement"
2016-11-02 21:37:30 +03:00
}
]
},
"errors": {}
},
"filePaths": [
"if-statements.go"
],
2016-11-11 00:19:53 +03:00
"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()",
"-}"
],
2016-11-02 21:37:30 +03:00
"gitDir": "test/corpus/repos/go",
"shas": "da3e038ea5de3df0e12be8da86fc27d03b9b9a78..5b0d0fcabc4550b5ca54d8c47fbe0708b1f4d029"
2016-11-02 21:37:30 +03:00
}]