1
1
mirror of https://github.com/github/semantic.git synced 2024-12-23 14:54:16 +03:00
semantic/test/corpus/diff-summaries/go/for-statements.json

831 lines
26 KiB
JSON

[{
"testCaseDescription": "go-for-statements-setup-test",
"expectedResult": {
"changes": {
"for-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": [
"for-statements.go"
],
"patch": [
"diff --git a/for-statements.go b/for-statements.go",
"index e69de29b..79058077 100644",
"--- a/for-statements.go",
"+++ b/for-statements.go",
"@@ -0,0 +1,5 @@",
"+package main",
"+",
"+func main() {",
"+",
"+}"
],
"gitDir": "test/corpus/repos/go",
"shas": "7e17cc64d3af30fc40de0aec1f9ca02d3b2390b1..dc2ec1b41f76d7ea5a1a5ddf2faf1da473f23ba8"
}
,{
"testCaseDescription": "go-for-statements-insert-test",
"expectedResult": {
"changes": {
"for-statements.go": [
{
"span": {
"insert": {
"start": [
5,
1
],
"end": [
5,
4
]
}
},
"summary": "Added the 'a()' function call in the main function"
},
{
"span": {
"insert": {
"start": [
6,
6
],
"end": [
6,
10
]
}
},
"summary": "Added the 'loop' identifier in the main function"
},
{
"span": {
"insert": {
"start": [
8,
1
],
"end": [
11,
2
]
}
},
"summary": "Added the 'i := 0; i < 5; i++' for statement in the main function"
},
{
"span": {
"insert": {
"start": [
12,
1
],
"end": [
15,
2
]
}
},
"summary": "Added the 'i < 10; i++' for statement in the main function"
},
{
"span": {
"insert": {
"start": [
16,
1
],
"end": [
19,
2
]
}
},
"summary": "Added the 'for ;; {\na()\ncontinue\n}' for statement in the main function"
},
{
"span": {
"insert": {
"start": [
20,
1
],
"end": [
23,
2
]
}
},
"summary": "Added the 'x := range y' for statement in the main function"
}
]
},
"errors": {}
},
"filePaths": [
"for-statements.go"
],
"patch": [
"diff --git a/for-statements.go b/for-statements.go",
"index 79058077..66e5f7a4 100644",
"--- a/for-statements.go",
"+++ b/for-statements.go",
"@@ -1,5 +1,24 @@",
" package main",
" ",
" func main() {",
"-",
"+ for {",
"+a()",
"+goto loop",
"+}",
"+for i := 0; i < 5; i++ {",
"+a()",
"+break loop",
"+}",
"+for ; i < 10; i++ {",
"+a()",
"+continue loop2",
"+}",
"+for ;; {",
"+a()",
"+continue",
"+}",
"+for x := range y {",
"+a(x)",
"+break",
"+}",
" }"
],
"gitDir": "test/corpus/repos/go",
"shas": "dc2ec1b41f76d7ea5a1a5ddf2faf1da473f23ba8..6f907cfe4d6df1013dcff56ac60b69291ee043e9"
}
,{
"testCaseDescription": "go-for-statements-replacement-test",
"expectedResult": {
"changes": {
"for-statements.go": [
{
"span": {
"insert": {
"start": [
4,
2
],
"end": [
7,
2
]
}
},
"summary": "Added the 'for ;; {\na()\ngoto loop\n}' for statement in the main function"
},
{
"span": {
"insert": {
"start": [
8,
1
],
"end": [
11,
2
]
}
},
"summary": "Added the 'x := range y' for statement in the main function"
},
{
"span": {
"insert": {
"start": [
12,
1
],
"end": [
15,
2
]
}
},
"summary": "Added the 'for ;; {\na()\ncontinue loop2\n}' for statement in the main function"
},
{
"span": {
"insert": {
"start": [
16,
1
],
"end": [
19,
2
]
}
},
"summary": "Added the 'i < 10; i++' for statement in the main function"
},
{
"span": {
"insert": {
"start": [
21,
3
],
"end": [
21,
4
]
}
},
"summary": "Added the 'x' identifier in the a(x) function call of the 'main' function"
},
{
"span": {
"insert": {
"start": [
22,
1
],
"end": [
22,
6
]
}
},
"summary": "Added a break statement in the main function"
},
{
"span": {
"delete": {
"start": [
6,
6
],
"end": [
6,
10
]
}
},
"summary": "Deleted the 'loop' identifier in the main function"
},
{
"span": {
"delete": {
"start": [
8,
1
],
"end": [
11,
2
]
}
},
"summary": "Deleted the 'i := 0; i < 5; i++' for statement in the main function"
},
{
"span": {
"delete": {
"start": [
12,
1
],
"end": [
15,
2
]
}
},
"summary": "Deleted the 'i < 10; i++' for statement in the main function"
},
{
"span": {
"delete": {
"start": [
16,
1
],
"end": [
19,
2
]
}
},
"summary": "Deleted the 'for ;; {\na()\ncontinue\n}' for statement in the main function"
},
{
"span": {
"delete": {
"start": [
20,
1
],
"end": [
23,
2
]
}
},
"summary": "Deleted the 'x := range y' for statement in the main function"
}
]
},
"errors": {}
},
"filePaths": [
"for-statements.go"
],
"patch": [
"diff --git a/for-statements.go b/for-statements.go",
"index 66e5f7a4..4099658c 100644",
"--- a/for-statements.go",
"+++ b/for-statements.go",
"@@ -1,23 +1,23 @@",
" package main",
" ",
" func main() {",
"- for {",
"+ for ;; {",
" a()",
" goto loop",
" }",
"-for i := 0; i < 5; i++ {",
"+for x := range y {",
" a()",
" break loop",
" }",
"-for ; i < 10; i++ {",
"+for ;; {",
" a()",
" continue loop2",
" }",
"-for ;; {",
"+for ; i < 10; i++ {",
" a()",
" continue",
" }",
"-for x := range y {",
"+for {",
" a(x)",
" break",
" }"
],
"gitDir": "test/corpus/repos/go",
"shas": "6f907cfe4d6df1013dcff56ac60b69291ee043e9..828011b4419110ea1474929db33cc75dc2187a66"
}
,{
"testCaseDescription": "go-for-statements-delete-replacement-test",
"expectedResult": {
"changes": {
"for-statements.go": [
{
"span": {
"insert": {
"start": [
5,
1
],
"end": [
5,
4
]
}
},
"summary": "Added the 'a()' function call in the main function"
},
{
"span": {
"insert": {
"start": [
6,
6
],
"end": [
6,
10
]
}
},
"summary": "Added the 'loop' identifier in the main function"
},
{
"span": {
"insert": {
"start": [
8,
1
],
"end": [
11,
2
]
}
},
"summary": "Added the 'i := 0; i < 5; i++' for statement in the main function"
},
{
"span": {
"insert": {
"start": [
12,
1
],
"end": [
15,
2
]
}
},
"summary": "Added the 'i < 10; i++' for statement in the main function"
},
{
"span": {
"replace": [
{
"start": [
4,
2
],
"end": [
7,
2
]
},
{
"start": [
16,
1
],
"end": [
19,
2
]
}
]
},
"summary": "Replaced the 'for ;; {\na()\ngoto loop\n}' for statement with the 'for ;; {\na()\ncontinue\n}' for statement in the main function"
},
{
"span": {
"insert": {
"start": [
21,
3
],
"end": [
21,
4
]
}
},
"summary": "Added the 'x' identifier in the a(x) function call of the 'main' function"
},
{
"span": {
"delete": {
"start": [
10,
7
],
"end": [
10,
11
]
}
},
"summary": "Deleted the 'loop' identifier in the main function"
},
{
"span": {
"delete": {
"start": [
12,
1
],
"end": [
15,
2
]
}
},
"summary": "Deleted the 'for ;; {\na()\ncontinue loop2\n}' for statement in the main function"
},
{
"span": {
"delete": {
"start": [
16,
1
],
"end": [
19,
2
]
}
},
"summary": "Deleted the 'i < 10; i++' for statement in the main function"
},
{
"span": {
"delete": {
"start": [
21,
1
],
"end": [
21,
5
]
}
},
"summary": "Deleted the 'a(x)' function call in the main function"
},
{
"span": {
"delete": {
"start": [
22,
1
],
"end": [
22,
6
]
}
},
"summary": "Deleted a break statement in the main function"
}
]
},
"errors": {}
},
"filePaths": [
"for-statements.go"
],
"patch": [
"diff --git a/for-statements.go b/for-statements.go",
"index 4099658c..66e5f7a4 100644",
"--- a/for-statements.go",
"+++ b/for-statements.go",
"@@ -1,23 +1,23 @@",
" package main",
" ",
" func main() {",
"- for ;; {",
"+ for {",
" a()",
" goto loop",
" }",
"-for x := range y {",
"+for i := 0; i < 5; i++ {",
" a()",
" break loop",
" }",
"-for ;; {",
"+for ; i < 10; i++ {",
" a()",
" continue loop2",
" }",
"-for ; i < 10; i++ {",
"+for ;; {",
" a()",
" continue",
" }",
"-for {",
"+for x := range y {",
" a(x)",
" break",
" }"
],
"gitDir": "test/corpus/repos/go",
"shas": "828011b4419110ea1474929db33cc75dc2187a66..1ebe72d311e2427aed13a5cd15165af3c871aeda"
}
,{
"testCaseDescription": "go-for-statements-delete-insert-test",
"expectedResult": {
"changes": {
"for-statements.go": [
{
"span": {
"delete": {
"start": [
5,
1
],
"end": [
5,
4
]
}
},
"summary": "Deleted the 'a()' function call in the main function"
},
{
"span": {
"delete": {
"start": [
6,
6
],
"end": [
6,
10
]
}
},
"summary": "Deleted the 'loop' identifier in the main function"
},
{
"span": {
"delete": {
"start": [
8,
1
],
"end": [
11,
2
]
}
},
"summary": "Deleted the 'i := 0; i < 5; i++' for statement in the main function"
},
{
"span": {
"delete": {
"start": [
12,
1
],
"end": [
15,
2
]
}
},
"summary": "Deleted the 'i < 10; i++' for statement in the main function"
},
{
"span": {
"delete": {
"start": [
16,
1
],
"end": [
19,
2
]
}
},
"summary": "Deleted the 'for ;; {\na()\ncontinue\n}' for statement in the main function"
},
{
"span": {
"delete": {
"start": [
20,
1
],
"end": [
23,
2
]
}
},
"summary": "Deleted the 'x := range y' for statement in the main function"
}
]
},
"errors": {}
},
"filePaths": [
"for-statements.go"
],
"patch": [
"diff --git a/for-statements.go b/for-statements.go",
"index 66e5f7a4..79058077 100644",
"--- a/for-statements.go",
"+++ b/for-statements.go",
"@@ -1,24 +1,5 @@",
" package main",
" ",
" func main() {",
"- for {",
"-a()",
"-goto loop",
"-}",
"-for i := 0; i < 5; i++ {",
"-a()",
"-break loop",
"-}",
"-for ; i < 10; i++ {",
"-a()",
"-continue loop2",
"-}",
"-for ;; {",
"-a()",
"-continue",
"-}",
"-for x := range y {",
"-a(x)",
"-break",
"-}",
"+",
" }"
],
"gitDir": "test/corpus/repos/go",
"shas": "1ebe72d311e2427aed13a5cd15165af3c871aeda..f45bcd20bd6ba383ac859a429fe4529fd1bd3953"
}
,{
"testCaseDescription": "go-for-statements-teardown-test",
"expectedResult": {
"changes": {
"for-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": [
"for-statements.go"
],
"patch": [
"diff --git a/for-statements.go b/for-statements.go",
"index 79058077..e69de29b 100644",
"--- a/for-statements.go",
"+++ b/for-statements.go",
"@@ -1,5 +0,0 @@",
"-package main",
"-",
"-func main() {",
"-",
"-}"
],
"gitDir": "test/corpus/repos/go",
"shas": "f45bcd20bd6ba383ac859a429fe4529fd1bd3953..67505136f185d3093753d4cb0b1c44e2d11dccfc"
}]