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

489 lines
15 KiB
JSON
Raw Normal View History

2016-11-02 21:37:30 +03:00
[{
2016-12-02 00:03:52 +03:00
"testCaseDescription": "go-if-statements-setup-test",
2016-11-02 21:37:30 +03:00
"expectedResult": {
"changes": {
"if-statements.go": [
{
"span": {
2016-11-11 00:19:53 +03:00
"insert": {
"start": [
1,
1
],
"end": [
6,
1
]
}
},
2016-12-02 00:03:52 +03:00
"summary": "Added the 'main' module"
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",
2016-12-02 00:03:52 +03:00
"index e69de29..7905807 100644",
2016-11-11 00:19:53 +03:00
"--- a/if-statements.go",
"+++ b/if-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
"+}"
],
2016-11-02 21:37:30 +03:00
"gitDir": "test/corpus/repos/go",
2017-01-09 23:13:55 +03:00
"shas": "4631150a68594dfe09ecb65b028d01e8e9fcf06a..8f32506bb348c0449921609a7f6fe42e6e05df5b"
2016-11-02 21:37:30 +03:00
}
,{
2016-12-02 00:03:52 +03:00
"testCaseDescription": "go-if-statements-insert-test",
2016-11-02 21:37:30 +03:00
"expectedResult": {
"changes": {
"if-statements.go": [
{
"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-12-02 00:03:52 +03:00
"summary": "Added the 'a()' if statement in the main function of the 'main' module"
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-12-02 00:03:52 +03:00
9,
2016-11-03 01:09:32 +03:00
2
2016-11-02 21:37:30 +03:00
]
}
},
2016-12-02 00:03:52 +03:00
"summary": "Added the 'a := b(); c' if statement in the main function of the 'main' module"
2016-11-02 21:37:30 +03:00
},
{
"span": {
"insert": {
"start": [
2016-12-02 00:03:52 +03:00
10,
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-12-02 00:03:52 +03:00
"summary": "Added the 'a()' if statement in the main function of the 'main' module"
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",
2016-12-02 00:03:52 +03:00
"index 7905807..76a6f33 100644",
2016-11-11 00:19:53 +03:00
"--- a/if-statements.go",
"+++ b/if-statements.go",
2016-12-02 00:03:52 +03:00
"@@ -1,5 +1,15 @@",
" package main",
" ",
" func main() {",
"-",
2016-11-11 00:19:53 +03:00
"+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",
2017-01-09 23:13:55 +03:00
"shas": "8f32506bb348c0449921609a7f6fe42e6e05df5b..74e8338f550fc9ceeb359d85c87e641155398b95"
2016-11-02 21:37:30 +03:00
}
,{
2016-12-02 00:03:52 +03:00
"testCaseDescription": "go-if-statements-replacement-test",
2016-11-02 21:37:30 +03:00
"expectedResult": {
"changes": {
"if-statements.go": [
{
"span": {
"replace": [
{
"start": [
2016-12-02 00:03:52 +03:00
4,
2016-11-02 21:37:30 +03:00
4
],
"end": [
2016-12-02 00:03:52 +03:00
4,
2016-11-02 21:37:30 +03:00
5
]
},
{
"start": [
2016-12-02 00:03:52 +03:00
4,
2016-11-02 21:37:30 +03:00
4
],
"end": [
2016-12-02 00:03:52 +03:00
4,
2016-11-02 21:37:30 +03:00
5
]
}
]
},
2016-12-02 00:03:52 +03:00
"summary": "Replaced the 'a' identifier with the 'x' identifier in the x() function call of the 'main' function"
2016-11-02 21:37:30 +03:00
},
{
"span": {
"replace": [
{
"start": [
2016-12-02 00:03:52 +03:00
7,
2016-11-02 21:37:30 +03:00
4
],
"end": [
2016-12-02 00:03:52 +03:00
7,
2016-11-02 21:37:30 +03:00
5
]
},
{
"start": [
2016-12-02 00:03:52 +03:00
7,
2016-11-02 21:37:30 +03:00
4
],
"end": [
2016-12-02 00:03:52 +03:00
7,
2016-11-02 21:37:30 +03:00
5
]
}
]
},
2016-12-02 00:03:52 +03:00
"summary": "Replaced the 'a' identifier with the 'y' identifier in the y variable of the 'main' function"
2016-11-02 21:37:30 +03:00
},
{
"span": {
"replace": [
{
"start": [
2016-12-02 00:03:52 +03:00
10,
2016-11-02 21:37:30 +03:00
4
],
"end": [
2016-12-02 00:03:52 +03:00
10,
2016-11-02 21:37:30 +03:00
5
]
},
{
"start": [
2016-12-02 00:03:52 +03:00
10,
2016-11-02 21:37:30 +03:00
4
],
"end": [
2016-12-02 00:03:52 +03:00
10,
2016-11-02 21:37:30 +03:00
5
]
}
]
},
2016-12-02 00:03:52 +03:00
"summary": "Replaced the 'a' identifier with the 'z' identifier in the z() function call of the 'main' function"
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",
2016-12-02 00:03:52 +03:00
"index 76a6f33..39dfc0d 100644",
2016-11-11 00:19:53 +03:00
"--- a/if-statements.go",
"+++ b/if-statements.go",
2016-12-02 00:03:52 +03:00
"@@ -1,13 +1,13 @@",
" package main",
" ",
" func main() {",
"-if a() {",
"+if x() {",
2016-11-11 00:19:53 +03:00
" b()",
" }",
2016-12-02 00:03:52 +03:00
"-if a := b(); c {",
"+if y := b(); c {",
2016-11-11 00:19:53 +03:00
" d()",
" }",
2016-12-02 00:03:52 +03:00
"-if a() {",
"+if z() {",
2016-11-11 00:19:53 +03:00
" b()",
" } else {",
" c()"
],
2016-11-02 21:37:30 +03:00
"gitDir": "test/corpus/repos/go",
2017-01-09 23:13:55 +03:00
"shas": "74e8338f550fc9ceeb359d85c87e641155398b95..bc5b4ea61737fd3cc9a5195e7da526401d615345"
2016-11-02 21:37:30 +03:00
}
,{
2016-12-02 00:03:52 +03:00
"testCaseDescription": "go-if-statements-delete-replacement-test",
2016-11-02 21:37:30 +03:00
"expectedResult": {
"changes": {
"if-statements.go": [
{
"span": {
"replace": [
{
"start": [
2016-12-02 00:03:52 +03:00
4,
2016-11-02 21:37:30 +03:00
4
],
"end": [
2016-12-02 00:03:52 +03:00
4,
2016-11-02 21:37:30 +03:00
5
]
},
{
"start": [
2016-12-02 00:03:52 +03:00
4,
2016-11-02 21:37:30 +03:00
4
],
"end": [
2016-12-02 00:03:52 +03:00
4,
2016-11-02 21:37:30 +03:00
5
]
}
]
},
2016-12-02 00:03:52 +03:00
"summary": "Replaced the 'x' identifier with the 'a' identifier in the a() function call of the 'main' function"
2016-11-02 21:37:30 +03:00
},
{
"span": {
"replace": [
{
"start": [
2016-12-02 00:03:52 +03:00
7,
2016-11-02 21:37:30 +03:00
4
],
"end": [
2016-12-02 00:03:52 +03:00
7,
2016-11-02 21:37:30 +03:00
5
]
},
{
"start": [
2016-12-02 00:03:52 +03:00
7,
2016-11-02 21:37:30 +03:00
4
],
"end": [
2016-12-02 00:03:52 +03:00
7,
2016-11-02 21:37:30 +03:00
5
]
}
]
},
2016-12-02 00:03:52 +03:00
"summary": "Replaced the 'y' identifier with the 'a' identifier in the a variable of the 'main' function"
2016-11-02 21:37:30 +03:00
},
{
"span": {
"replace": [
{
"start": [
2016-12-02 00:03:52 +03:00
10,
2016-11-02 21:37:30 +03:00
4
],
"end": [
2016-12-02 00:03:52 +03:00
10,
2016-11-02 21:37:30 +03:00
5
]
},
{
"start": [
2016-12-02 00:03:52 +03:00
10,
2016-11-02 21:37:30 +03:00
4
],
"end": [
2016-12-02 00:03:52 +03:00
10,
2016-11-02 21:37:30 +03:00
5
]
}
]
},
2016-12-02 00:03:52 +03:00
"summary": "Replaced the 'z' identifier with the 'a' identifier in the a() function call of the 'main' function"
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",
2016-12-02 00:03:52 +03:00
"index 39dfc0d..76a6f33 100644",
2016-11-11 00:19:53 +03:00
"--- a/if-statements.go",
"+++ b/if-statements.go",
2016-12-02 00:03:52 +03:00
"@@ -1,13 +1,13 @@",
" package main",
" ",
" func main() {",
"-if x() {",
"+if a() {",
2016-11-11 00:19:53 +03:00
" b()",
" }",
2016-12-02 00:03:52 +03:00
"-if y := b(); c {",
"+if a := b(); c {",
2016-11-11 00:19:53 +03:00
" d()",
" }",
2016-12-02 00:03:52 +03:00
"-if z() {",
"+if a() {",
2016-11-11 00:19:53 +03:00
" b()",
" } else {",
" c()"
],
2016-11-02 21:37:30 +03:00
"gitDir": "test/corpus/repos/go",
2017-01-09 23:13:55 +03:00
"shas": "bc5b4ea61737fd3cc9a5195e7da526401d615345..bc37ce6b071de98dd3bece87cc64ce97b0da4f17"
2016-11-02 21:37:30 +03:00
}
,{
2016-12-02 00:03:52 +03:00
"testCaseDescription": "go-if-statements-delete-insert-test",
2016-11-02 21:37:30 +03:00
"expectedResult": {
"changes": {
"if-statements.go": [
{
"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-12-02 00:03:52 +03:00
"summary": "Deleted the 'a()' if statement in the main function of the 'main' module"
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-12-02 00:03:52 +03:00
9,
2016-11-03 01:09:32 +03:00
2
2016-11-02 21:37:30 +03:00
]
}
},
2016-12-02 00:03:52 +03:00
"summary": "Deleted the 'a := b(); c' if statement in the main function of the 'main' module"
2016-11-02 21:37:30 +03:00
},
{
"span": {
"delete": {
"start": [
2016-12-02 00:03:52 +03:00
10,
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-12-02 00:03:52 +03:00
"summary": "Deleted the 'a()' if statement in the main function of the 'main' module"
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",
2016-12-02 00:03:52 +03:00
"index 76a6f33..7905807 100644",
2016-11-11 00:19:53 +03:00
"--- a/if-statements.go",
"+++ b/if-statements.go",
2016-12-02 00:03:52 +03:00
"@@ -1,15 +1,5 @@",
" package main",
" ",
" func main() {",
2016-11-11 00:19:53 +03:00
"-if a() {",
"-b()",
"-}",
"-if a := b(); c {",
"-d()",
"-}",
"-if a() {",
"-b()",
"-} else {",
"-c()",
"-}",
2016-12-02 00:03:52 +03:00
"+",
2016-11-11 00:19:53 +03:00
" }"
],
2016-11-02 21:37:30 +03:00
"gitDir": "test/corpus/repos/go",
2017-01-09 23:13:55 +03:00
"shas": "bc37ce6b071de98dd3bece87cc64ce97b0da4f17..087348e2184ee9442a75794a0ee21a58d63c86fe"
2016-11-02 21:37:30 +03:00
}
,{
2016-12-02 00:03:52 +03:00
"testCaseDescription": "go-if-statements-teardown-test",
2016-11-02 21:37:30 +03:00
"expectedResult": {
"changes": {
"if-statements.go": [
{
"span": {
2016-11-11 00:19:53 +03:00
"delete": {
"start": [
1,
1
],
"end": [
6,
1
]
}
2016-11-02 21:37:30 +03:00
},
2016-12-02 00:03:52 +03:00
"summary": "Deleted the 'main' module"
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",
2016-12-02 00:03:52 +03:00
"index 7905807..e69de29 100644",
2016-11-11 00:19:53 +03:00
"--- a/if-statements.go",
"+++ b/if-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 21:37:30 +03:00
"gitDir": "test/corpus/repos/go",
2017-01-09 23:13:55 +03:00
"shas": "087348e2184ee9442a75794a0ee21a58d63c86fe..1070e71cda96a0476c6f6542fd4eea44080bffdb"
2016-11-02 21:37:30 +03:00
}]