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/for-statements.json
2016-12-01 16:03:52 -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": "678323dd89ca74cd5fe06c4efdc8ec7abe45b581..458188dab2858f9fc6b0d6955ad5cd65c6a7f2e5"
}
,{
"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": "458188dab2858f9fc6b0d6955ad5cd65c6a7f2e5..f86745509a4baa05a4bd6b2c8384ae4da2c0f7d4"
}
,{
"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": "f86745509a4baa05a4bd6b2c8384ae4da2c0f7d4..d28754ec27eec808434ebc246d952065b07b9daf"
}
,{
"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": "d28754ec27eec808434ebc246d952065b07b9daf..5b574c3f53c7280d575bac8570cc7ddd8b3ddd23"
}
,{
"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": "5b574c3f53c7280d575bac8570cc7ddd8b3ddd23..417cf9ad568c1eb652c601c65c77f2f1d845ca33"
}
,{
"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": "417cf9ad568c1eb652c601c65c77f2f1d845ca33..1854d5f55250893392d152736636fdb9dd9b51e8"
}]