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
2016-12-07 13:26:31 -05:00

723 lines
22 KiB
JSON

[{
"testCaseDescription": "go-for-statements-setup-test",
"expectedResult": {
"changes": {
"for-statements.go": [
{
"span": {
"insert": {
"start": [
1,
1
],
"end": [
6,
1
]
}
},
"summary": "Added the 'main' module"
}
]
},
"errors": {}
},
"filePaths": [
"for-statements.go"
],
"patch": [
"diff --git a/for-statements.go b/for-statements.go",
"index e69de29..7905807 100644",
"--- a/for-statements.go",
"+++ b/for-statements.go",
"@@ -0,0 +1,5 @@",
"+package main",
"+",
"+func main() {",
"+",
"+}"
],
"gitDir": "test/corpus/repos/go",
"shas": "ccdfcd699b0b7f784aabb584fafa22532034b988..fb29808fc2e1adbc7cdeb7e427e2fc5877f4f7ff"
}
,{
"testCaseDescription": "go-for-statements-insert-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 of the 'main' module"
},
{
"span": {
"insert": {
"start": [
8,
1
],
"end": [
11,
2
]
}
},
"summary": "Added the 'i := 0; i < 5; i++' for statement in the main function of the 'main' module"
},
{
"span": {
"insert": {
"start": [
12,
1
],
"end": [
15,
2
]
}
},
"summary": "Added the 'i < 10; i++' for statement in the main function of the 'main' module"
},
{
"span": {
"insert": {
"start": [
16,
1
],
"end": [
19,
2
]
}
},
"summary": "Added the 'for ;; {\na()\ncontinue\n}' for statement in the main function of the 'main' module"
},
{
"span": {
"insert": {
"start": [
20,
1
],
"end": [
23,
2
]
}
},
"summary": "Added the 'x := range y' for statement in the main function of the 'main' module"
}
]
},
"errors": {}
},
"filePaths": [
"for-statements.go"
],
"patch": [
"diff --git a/for-statements.go b/for-statements.go",
"index 7905807..66e5f7a 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": "fb29808fc2e1adbc7cdeb7e427e2fc5877f4f7ff..06298bc2b4716d8ef5879f4d5619bfb4f7bcb97f"
}
,{
"testCaseDescription": "go-for-statements-replacement-test",
"expectedResult": {
"changes": {
"for-statements.go": [
{
"span": {
"replace": [
{
"start": [
8,
1
],
"end": [
11,
2
]
},
{
"start": [
8,
1
],
"end": [
11,
2
]
}
]
},
"summary": "Replaced the 'i := 0; i < 5; i++' for statement with the 'x := range y' for statement in the main function of the 'main' module"
},
{
"span": {
"delete": {
"start": [
12,
7
],
"end": [
12,
8
]
}
},
"summary": "Deleted 'i' identifier in the main function of the 'main' module"
},
{
"span": {
"delete": {
"start": [
12,
11
],
"end": [
12,
13
]
}
},
"summary": "Deleted '10' in the main function of the 'main' module"
},
{
"span": {
"delete": {
"start": [
12,
15
],
"end": [
12,
16
]
}
},
"summary": "Deleted the 'i' identifier in the main function of the 'main' module"
},
{
"span": {
"insert": {
"start": [
16,
7
],
"end": [
16,
8
]
}
},
"summary": "Added 'i' identifier in the main function of the 'main' module"
},
{
"span": {
"insert": {
"start": [
16,
11
],
"end": [
16,
13
]
}
},
"summary": "Added '10' in the main function of the 'main' module"
},
{
"span": {
"insert": {
"start": [
16,
15
],
"end": [
16,
16
]
}
},
"summary": "Added the 'i' identifier in the main function of the 'main' module"
},
{
"span": {
"delete": {
"start": [
20,
5
],
"end": [
20,
6
]
}
},
"summary": "Deleted the 'x' identifier in the main function of the 'main' module"
},
{
"span": {
"delete": {
"start": [
20,
16
],
"end": [
20,
17
]
}
},
"summary": "Deleted the 'y' identifier in the main function of the 'main' module"
}
]
},
"errors": {}
},
"filePaths": [
"for-statements.go"
],
"patch": [
"diff --git a/for-statements.go b/for-statements.go",
"index 66e5f7a..4099658 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": "06298bc2b4716d8ef5879f4d5619bfb4f7bcb97f..7545aeccbd059f4cf6ddf19e0f6bea0083c16a57"
}
,{
"testCaseDescription": "go-for-statements-delete-replacement-test",
"expectedResult": {
"changes": {
"for-statements.go": [
{
"span": {
"replace": [
{
"start": [
8,
1
],
"end": [
11,
2
]
},
{
"start": [
8,
1
],
"end": [
11,
2
]
}
]
},
"summary": "Replaced the 'x := range y' for statement with the 'i := 0; i < 5; i++' for statement in the main function of the 'main' module"
},
{
"span": {
"insert": {
"start": [
12,
7
],
"end": [
12,
8
]
}
},
"summary": "Added 'i' identifier in the main function of the 'main' module"
},
{
"span": {
"insert": {
"start": [
12,
11
],
"end": [
12,
13
]
}
},
"summary": "Added '10' in the main function of the 'main' module"
},
{
"span": {
"insert": {
"start": [
12,
15
],
"end": [
12,
16
]
}
},
"summary": "Added the 'i' identifier in the main function of the 'main' module"
},
{
"span": {
"delete": {
"start": [
16,
7
],
"end": [
16,
8
]
}
},
"summary": "Deleted 'i' identifier in the main function of the 'main' module"
},
{
"span": {
"delete": {
"start": [
16,
11
],
"end": [
16,
13
]
}
},
"summary": "Deleted '10' in the main function of the 'main' module"
},
{
"span": {
"delete": {
"start": [
16,
15
],
"end": [
16,
16
]
}
},
"summary": "Deleted the 'i' identifier in the main function of the 'main' module"
},
{
"span": {
"insert": {
"start": [
20,
5
],
"end": [
20,
6
]
}
},
"summary": "Added the 'x' identifier in the main function of the 'main' module"
},
{
"span": {
"insert": {
"start": [
20,
16
],
"end": [
20,
17
]
}
},
"summary": "Added the 'y' identifier in the main function of the 'main' module"
}
]
},
"errors": {}
},
"filePaths": [
"for-statements.go"
],
"patch": [
"diff --git a/for-statements.go b/for-statements.go",
"index 4099658..66e5f7a 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": "7545aeccbd059f4cf6ddf19e0f6bea0083c16a57..3e639f39d94a7e66fc2f62c6098037ee7830006e"
}
,{
"testCaseDescription": "go-for-statements-delete-insert-test",
"expectedResult": {
"changes": {
"for-statements.go": [
{
"span": {
"delete": {
"start": [
4,
2
],
"end": [
7,
2
]
}
},
"summary": "Deleted the 'for {\na()\ngoto loop\n}' for statement in the main function of the 'main' module"
},
{
"span": {
"delete": {
"start": [
8,
1
],
"end": [
11,
2
]
}
},
"summary": "Deleted the 'i := 0; i < 5; i++' for statement in the main function of the 'main' module"
},
{
"span": {
"delete": {
"start": [
12,
1
],
"end": [
15,
2
]
}
},
"summary": "Deleted the 'i < 10; i++' for statement in the main function of the 'main' module"
},
{
"span": {
"delete": {
"start": [
16,
1
],
"end": [
19,
2
]
}
},
"summary": "Deleted the 'for ;; {\na()\ncontinue\n}' for statement in the main function of the 'main' module"
},
{
"span": {
"delete": {
"start": [
20,
1
],
"end": [
23,
2
]
}
},
"summary": "Deleted the 'x := range y' for statement in the main function of the 'main' module"
}
]
},
"errors": {}
},
"filePaths": [
"for-statements.go"
],
"patch": [
"diff --git a/for-statements.go b/for-statements.go",
"index 66e5f7a..7905807 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": "3e639f39d94a7e66fc2f62c6098037ee7830006e..8d472c4d6d1c6fef406a374b69e70456848b267b"
}
,{
"testCaseDescription": "go-for-statements-teardown-test",
"expectedResult": {
"changes": {
"for-statements.go": [
{
"span": {
"delete": {
"start": [
1,
1
],
"end": [
6,
1
]
}
},
"summary": "Deleted the 'main' module"
}
]
},
"errors": {}
},
"filePaths": [
"for-statements.go"
],
"patch": [
"diff --git a/for-statements.go b/for-statements.go",
"index 7905807..e69de29 100644",
"--- a/for-statements.go",
"+++ b/for-statements.go",
"@@ -1,5 +0,0 @@",
"-package main",
"-",
"-func main() {",
"-",
"-}"
],
"gitDir": "test/corpus/repos/go",
"shas": "8d472c4d6d1c6fef406a374b69e70456848b267b..d458ed87c1f3ee07648598fe75c4d08d930fc3f1"
}]