mirror of
https://github.com/github/semantic.git
synced 2024-12-23 14:54:16 +03:00
519 lines
16 KiB
JSON
519 lines
16 KiB
JSON
[{
|
|
"testCaseDescription": "go-if-statements-setup-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"if-statements.go": [
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
1,
|
|
13
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
3,
|
|
1
|
|
],
|
|
"end": [
|
|
5,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'main' function"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"if-statements.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/if-statements.go b/if-statements.go",
|
|
"index e69de29b..79058077 100644",
|
|
"--- a/if-statements.go",
|
|
"+++ b/if-statements.go",
|
|
"@@ -0,0 +1,5 @@",
|
|
"+package main",
|
|
"+",
|
|
"+func main() {",
|
|
"+",
|
|
"+}"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "844563260fa09b99d4cf94ec2ba5a65d9a5e6ded..7f05d434eeb7d4e475e8a5fefb8921bb958cc60d"
|
|
}
|
|
,{
|
|
"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"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
7,
|
|
1
|
|
],
|
|
"end": [
|
|
9,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'a := b()' if statement in the main function"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
10,
|
|
1
|
|
],
|
|
"end": [
|
|
14,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'a()' if statement in the main function"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"if-statements.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/if-statements.go b/if-statements.go",
|
|
"index 79058077..76a6f335 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": "7f05d434eeb7d4e475e8a5fefb8921bb958cc60d..045dae9fcac53782ce8bc04cd7d8b97eec6c13ca"
|
|
}
|
|
,{
|
|
"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 := b()' if statement 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 76a6f335..39dfc0da 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": "045dae9fcac53782ce8bc04cd7d8b97eec6c13ca..868fa819f5e273f493e8292b74593b773aa86193"
|
|
}
|
|
,{
|
|
"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 := b()' if statement 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 39dfc0da..76a6f335 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": "868fa819f5e273f493e8292b74593b773aa86193..53b5caeb25eac5493b68833e1139e280166f49ac"
|
|
}
|
|
,{
|
|
"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"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
7,
|
|
1
|
|
],
|
|
"end": [
|
|
9,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'a := b()' if statement in the main function"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
10,
|
|
1
|
|
],
|
|
"end": [
|
|
14,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'a()' if statement in the main function"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"if-statements.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/if-statements.go b/if-statements.go",
|
|
"index 76a6f335..79058077 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": "53b5caeb25eac5493b68833e1139e280166f49ac..0e1909c5e43a050032b2698a2f3e00d8598de19b"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-if-statements-teardown-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"if-statements.go": [
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
1,
|
|
13
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
3,
|
|
1
|
|
],
|
|
"end": [
|
|
5,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'main' function"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"if-statements.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/if-statements.go b/if-statements.go",
|
|
"index 79058077..e69de29b 100644",
|
|
"--- a/if-statements.go",
|
|
"+++ b/if-statements.go",
|
|
"@@ -1,5 +0,0 @@",
|
|
"-package main",
|
|
"-",
|
|
"-func main() {",
|
|
"-",
|
|
"-}"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "0e1909c5e43a050032b2698a2f3e00d8598de19b..1f7119ceb53f8159ac2330bdb3c78e76a19a5ed0"
|
|
}]
|