mirror of
https://github.com/github/semantic.git
synced 2024-12-25 07:55:12 +03:00
489 lines
15 KiB
JSON
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": "4631150a68594dfe09ecb65b028d01e8e9fcf06a..8f32506bb348c0449921609a7f6fe42e6e05df5b"
|
|
}
|
|
,{
|
|
"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": "8f32506bb348c0449921609a7f6fe42e6e05df5b..74e8338f550fc9ceeb359d85c87e641155398b95"
|
|
}
|
|
,{
|
|
"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": "74e8338f550fc9ceeb359d85c87e641155398b95..bc5b4ea61737fd3cc9a5195e7da526401d615345"
|
|
}
|
|
,{
|
|
"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": "bc5b4ea61737fd3cc9a5195e7da526401d615345..bc37ce6b071de98dd3bece87cc64ce97b0da4f17"
|
|
}
|
|
,{
|
|
"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": "bc37ce6b071de98dd3bece87cc64ce97b0da4f17..087348e2184ee9442a75794a0ee21a58d63c86fe"
|
|
}
|
|
,{
|
|
"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": "087348e2184ee9442a75794a0ee21a58d63c86fe..1070e71cda96a0476c6f6542fd4eea44080bffdb"
|
|
}]
|