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-12-01 16:03:52 -05:00

489 lines
15 KiB
JSON

[{
"testCaseDescription": "go-if-statements-setup-test",
"expectedResult": {
"changes": {
"if-statements.go": [
{
"span": {
"insert": {
"start": [
1,
1
],
"end": [
6,
1
]
}
},
"summary": "Added the 'main' module"
}
]
},
"errors": {}
},
"filePaths": [
"if-statements.go"
],
"patch": [
"diff --git a/if-statements.go b/if-statements.go",
"index e69de29..7905807 100644",
"--- a/if-statements.go",
"+++ b/if-statements.go",
"@@ -0,0 +1,5 @@",
"+package main",
"+",
"+func main() {",
"+",
"+}"
],
"gitDir": "test/corpus/repos/go",
"shas": "98a6dc74cc5a66c1d0c8f0d36bd0e08d21121e35..a7060305357a85db1db00a13648871f897f813f6"
}
,{
"testCaseDescription": "go-if-statements-insert-test",
"expectedResult": {
"changes": {
"if-statements.go": [
{
"span": {
"insert": {
"start": [
4,
1
],
"end": [
6,
2
]
}
},
"summary": "Added the 'a()' if statement in the main function of the 'main' module"
},
{
"span": {
"insert": {
"start": [
7,
1
],
"end": [
9,
2
]
}
},
"summary": "Added the 'a := b(); c' if statement in the main function of the 'main' module"
},
{
"span": {
"insert": {
"start": [
10,
1
],
"end": [
14,
2
]
}
},
"summary": "Added the 'a()' if statement in the main function of the 'main' module"
}
]
},
"errors": {}
},
"filePaths": [
"if-statements.go"
],
"patch": [
"diff --git a/if-statements.go b/if-statements.go",
"index 7905807..76a6f33 100644",
"--- a/if-statements.go",
"+++ b/if-statements.go",
"@@ -1,5 +1,15 @@",
" package main",
" ",
" func main() {",
"-",
"+if a() {",
"+b()",
"+}",
"+if a := b(); c {",
"+d()",
"+}",
"+if a() {",
"+b()",
"+} else {",
"+c()",
"+}",
" }"
],
"gitDir": "test/corpus/repos/go",
"shas": "a7060305357a85db1db00a13648871f897f813f6..aad8fd0302081ecdf38c3845a4c53c714e31b7de"
}
,{
"testCaseDescription": "go-if-statements-replacement-test",
"expectedResult": {
"changes": {
"if-statements.go": [
{
"span": {
"replace": [
{
"start": [
4,
4
],
"end": [
4,
5
]
},
{
"start": [
4,
4
],
"end": [
4,
5
]
}
]
},
"summary": "Replaced the 'a' identifier with the 'x' identifier in the x() function call of the 'main' function"
},
{
"span": {
"replace": [
{
"start": [
7,
4
],
"end": [
7,
5
]
},
{
"start": [
7,
4
],
"end": [
7,
5
]
}
]
},
"summary": "Replaced the 'a' identifier with the 'y' identifier in the y variable of the 'main' function"
},
{
"span": {
"replace": [
{
"start": [
10,
4
],
"end": [
10,
5
]
},
{
"start": [
10,
4
],
"end": [
10,
5
]
}
]
},
"summary": "Replaced the 'a' identifier with the 'z' identifier in the z() function call of the 'main' function"
}
]
},
"errors": {}
},
"filePaths": [
"if-statements.go"
],
"patch": [
"diff --git a/if-statements.go b/if-statements.go",
"index 76a6f33..39dfc0d 100644",
"--- a/if-statements.go",
"+++ b/if-statements.go",
"@@ -1,13 +1,13 @@",
" package main",
" ",
" func main() {",
"-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": "aad8fd0302081ecdf38c3845a4c53c714e31b7de..14aa0cf6c4b9326e486eb39ba7d6744743717cd1"
}
,{
"testCaseDescription": "go-if-statements-delete-replacement-test",
"expectedResult": {
"changes": {
"if-statements.go": [
{
"span": {
"replace": [
{
"start": [
4,
4
],
"end": [
4,
5
]
},
{
"start": [
4,
4
],
"end": [
4,
5
]
}
]
},
"summary": "Replaced the 'x' identifier with the 'a' identifier in the a() function call of the 'main' function"
},
{
"span": {
"replace": [
{
"start": [
7,
4
],
"end": [
7,
5
]
},
{
"start": [
7,
4
],
"end": [
7,
5
]
}
]
},
"summary": "Replaced the 'y' identifier with the 'a' identifier in the a variable of the 'main' function"
},
{
"span": {
"replace": [
{
"start": [
10,
4
],
"end": [
10,
5
]
},
{
"start": [
10,
4
],
"end": [
10,
5
]
}
]
},
"summary": "Replaced the 'z' identifier with the 'a' identifier in the a() function call of the 'main' function"
}
]
},
"errors": {}
},
"filePaths": [
"if-statements.go"
],
"patch": [
"diff --git a/if-statements.go b/if-statements.go",
"index 39dfc0d..76a6f33 100644",
"--- a/if-statements.go",
"+++ b/if-statements.go",
"@@ -1,13 +1,13 @@",
" package main",
" ",
" func main() {",
"-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": "14aa0cf6c4b9326e486eb39ba7d6744743717cd1..79e7dd408610f628f188e125563ef488ca21fbb0"
}
,{
"testCaseDescription": "go-if-statements-delete-insert-test",
"expectedResult": {
"changes": {
"if-statements.go": [
{
"span": {
"delete": {
"start": [
4,
1
],
"end": [
6,
2
]
}
},
"summary": "Deleted the 'a()' if statement in the main function of the 'main' module"
},
{
"span": {
"delete": {
"start": [
7,
1
],
"end": [
9,
2
]
}
},
"summary": "Deleted the 'a := b(); c' if statement in the main function of the 'main' module"
},
{
"span": {
"delete": {
"start": [
10,
1
],
"end": [
14,
2
]
}
},
"summary": "Deleted the 'a()' if statement in the main function of the 'main' module"
}
]
},
"errors": {}
},
"filePaths": [
"if-statements.go"
],
"patch": [
"diff --git a/if-statements.go b/if-statements.go",
"index 76a6f33..7905807 100644",
"--- a/if-statements.go",
"+++ b/if-statements.go",
"@@ -1,15 +1,5 @@",
" package main",
" ",
" func main() {",
"-if a() {",
"-b()",
"-}",
"-if a := b(); c {",
"-d()",
"-}",
"-if a() {",
"-b()",
"-} else {",
"-c()",
"-}",
"+",
" }"
],
"gitDir": "test/corpus/repos/go",
"shas": "79e7dd408610f628f188e125563ef488ca21fbb0..d3ae344d983e764cd814dbc2e9576237ca16027a"
}
,{
"testCaseDescription": "go-if-statements-teardown-test",
"expectedResult": {
"changes": {
"if-statements.go": [
{
"span": {
"delete": {
"start": [
1,
1
],
"end": [
6,
1
]
}
},
"summary": "Deleted the 'main' module"
}
]
},
"errors": {}
},
"filePaths": [
"if-statements.go"
],
"patch": [
"diff --git a/if-statements.go b/if-statements.go",
"index 7905807..e69de29 100644",
"--- a/if-statements.go",
"+++ b/if-statements.go",
"@@ -1,5 +0,0 @@",
"-package main",
"-",
"-func main() {",
"-",
"-}"
],
"gitDir": "test/corpus/repos/go",
"shas": "d3ae344d983e764cd814dbc2e9576237ca16027a..c15f3eb2a6003ef78012d02db50d2926c02e07b0"
}]