2016-11-02 05:05:43 +03:00
|
|
|
[{
|
2016-12-02 00:03:52 +03:00
|
|
|
"testCaseDescription": "go-for-statements-setup-test",
|
2016-11-02 05:05:43 +03:00
|
|
|
"expectedResult": {
|
|
|
|
"changes": {
|
|
|
|
"for-statements.go": [
|
|
|
|
{
|
|
|
|
"span": {
|
2016-11-11 00:19:53 +03:00
|
|
|
"insert": {
|
|
|
|
"start": [
|
|
|
|
1,
|
|
|
|
1
|
|
|
|
],
|
|
|
|
"end": [
|
2016-12-02 00:03:52 +03:00
|
|
|
6,
|
2016-11-11 00:19:53 +03:00
|
|
|
1
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2016-12-02 00:03:52 +03:00
|
|
|
"summary": "Added the 'main' module"
|
2016-11-02 05:05:43 +03:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"errors": {}
|
|
|
|
},
|
|
|
|
"filePaths": [
|
|
|
|
"for-statements.go"
|
|
|
|
],
|
2016-11-11 00:19:53 +03:00
|
|
|
"patch": [
|
|
|
|
"diff --git a/for-statements.go b/for-statements.go",
|
2016-12-02 00:03:52 +03:00
|
|
|
"index e69de29..7905807 100644",
|
2016-11-11 00:19:53 +03:00
|
|
|
"--- a/for-statements.go",
|
|
|
|
"+++ b/for-statements.go",
|
2016-12-02 00:03:52 +03:00
|
|
|
"@@ -0,0 +1,5 @@",
|
|
|
|
"+package main",
|
|
|
|
"+",
|
|
|
|
"+func main() {",
|
|
|
|
"+",
|
2016-11-11 00:19:53 +03:00
|
|
|
"+}"
|
|
|
|
],
|
2016-11-02 05:05:43 +03:00
|
|
|
"gitDir": "test/corpus/repos/go",
|
2017-01-11 00:21:35 +03:00
|
|
|
"shas": "242a94db5745d7e1c4b448f6253ca65bfa2b9821..cc0d1845575f9df74e0694efca6da9de1f47e7d1"
|
2016-11-02 05:05:43 +03:00
|
|
|
}
|
|
|
|
,{
|
2016-12-02 00:03:52 +03:00
|
|
|
"testCaseDescription": "go-for-statements-insert-test",
|
2016-11-02 05:05:43 +03:00
|
|
|
"expectedResult": {
|
|
|
|
"changes": {
|
|
|
|
"for-statements.go": [
|
|
|
|
{
|
|
|
|
"span": {
|
|
|
|
"insert": {
|
|
|
|
"start": [
|
2016-11-11 00:19:53 +03:00
|
|
|
4,
|
2016-11-10 23:36:44 +03:00
|
|
|
2
|
2016-11-02 05:05:43 +03:00
|
|
|
],
|
|
|
|
"end": [
|
2016-12-02 00:03:52 +03:00
|
|
|
7,
|
2016-11-10 23:36:44 +03:00
|
|
|
2
|
2016-11-02 05:05:43 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2016-12-02 00:03:52 +03:00
|
|
|
"summary": "Added the 'for {\na()\ngoto loop\n}' for statement in the main function of the 'main' module"
|
2016-11-02 05:05:43 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"span": {
|
|
|
|
"insert": {
|
|
|
|
"start": [
|
2016-12-02 00:03:52 +03:00
|
|
|
8,
|
2016-11-10 23:36:44 +03:00
|
|
|
1
|
2016-11-02 05:05:43 +03:00
|
|
|
],
|
|
|
|
"end": [
|
2016-12-02 00:03:52 +03:00
|
|
|
11,
|
2016-11-10 23:36:44 +03:00
|
|
|
2
|
2016-11-02 05:05:43 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2016-12-02 00:03:52 +03:00
|
|
|
"summary": "Added the 'i := 0; i < 5; i++' for statement in the main function of the 'main' module"
|
2016-11-02 05:05:43 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"span": {
|
|
|
|
"insert": {
|
|
|
|
"start": [
|
2016-12-02 00:03:52 +03:00
|
|
|
12,
|
2016-11-10 23:36:44 +03:00
|
|
|
1
|
2016-11-02 05:05:43 +03:00
|
|
|
],
|
|
|
|
"end": [
|
2016-12-02 00:03:52 +03:00
|
|
|
15,
|
2016-11-10 23:36:44 +03:00
|
|
|
2
|
2016-11-02 05:05:43 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2016-12-02 00:03:52 +03:00
|
|
|
"summary": "Added the 'i < 10; i++' for statement in the main function of the 'main' module"
|
2016-11-02 05:05:43 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"span": {
|
|
|
|
"insert": {
|
|
|
|
"start": [
|
2016-12-02 00:03:52 +03:00
|
|
|
16,
|
2016-11-03 01:46:48 +03:00
|
|
|
1
|
2016-11-02 05:05:43 +03:00
|
|
|
],
|
|
|
|
"end": [
|
2016-12-02 00:03:52 +03:00
|
|
|
19,
|
2016-11-10 23:36:44 +03:00
|
|
|
2
|
2016-11-02 05:05:43 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2016-12-02 00:03:52 +03:00
|
|
|
"summary": "Added the 'for ;; {\na()\ncontinue\n}' for statement in the main function of the 'main' module"
|
2016-11-02 05:05:43 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"span": {
|
|
|
|
"insert": {
|
|
|
|
"start": [
|
2016-12-02 00:03:52 +03:00
|
|
|
20,
|
2016-11-10 23:36:44 +03:00
|
|
|
1
|
2016-11-02 05:05:43 +03:00
|
|
|
],
|
|
|
|
"end": [
|
2016-12-02 00:03:52 +03:00
|
|
|
23,
|
2016-11-10 23:36:44 +03:00
|
|
|
2
|
2016-11-02 05:05:43 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2016-12-02 00:03:52 +03:00
|
|
|
"summary": "Added the 'x := range y' for statement in the main function of the 'main' module"
|
2016-11-10 23:36:44 +03:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"errors": {}
|
|
|
|
},
|
|
|
|
"filePaths": [
|
|
|
|
"for-statements.go"
|
|
|
|
],
|
2016-11-11 00:19:53 +03:00
|
|
|
"patch": [
|
|
|
|
"diff --git a/for-statements.go b/for-statements.go",
|
2016-12-02 00:03:52 +03:00
|
|
|
"index 7905807..66e5f7a 100644",
|
2016-11-11 00:19:53 +03:00
|
|
|
"--- a/for-statements.go",
|
|
|
|
"+++ b/for-statements.go",
|
2016-12-02 00:03:52 +03:00
|
|
|
"@@ -1,5 +1,24 @@",
|
|
|
|
" package main",
|
|
|
|
" ",
|
|
|
|
" func main() {",
|
|
|
|
"-",
|
2016-11-11 00:19:53 +03:00
|
|
|
"+ 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",
|
|
|
|
"+}",
|
2016-12-02 00:03:52 +03:00
|
|
|
" }"
|
2016-11-11 00:19:53 +03:00
|
|
|
],
|
2016-11-10 23:36:44 +03:00
|
|
|
"gitDir": "test/corpus/repos/go",
|
2017-01-11 00:21:35 +03:00
|
|
|
"shas": "cc0d1845575f9df74e0694efca6da9de1f47e7d1..49262e6046551f21fb4cd6e9060b8bbd29c40b7b"
|
2016-11-10 23:36:44 +03:00
|
|
|
}
|
|
|
|
,{
|
2016-12-02 00:03:52 +03:00
|
|
|
"testCaseDescription": "go-for-statements-replacement-test",
|
2016-11-10 23:36:44 +03:00
|
|
|
"expectedResult": {
|
|
|
|
"changes": {
|
|
|
|
"for-statements.go": [
|
2016-11-02 05:05:43 +03:00
|
|
|
{
|
|
|
|
"span": {
|
2016-11-10 23:36:44 +03:00
|
|
|
"replace": [
|
|
|
|
{
|
|
|
|
"start": [
|
2016-12-02 00:03:52 +03:00
|
|
|
8,
|
2016-11-10 23:36:44 +03:00
|
|
|
1
|
|
|
|
],
|
|
|
|
"end": [
|
2016-12-02 00:03:52 +03:00
|
|
|
11,
|
|
|
|
2
|
2016-11-10 23:36:44 +03:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"start": [
|
2016-12-02 00:03:52 +03:00
|
|
|
8,
|
2016-11-10 23:36:44 +03:00
|
|
|
1
|
|
|
|
],
|
|
|
|
"end": [
|
2016-12-02 00:03:52 +03:00
|
|
|
11,
|
|
|
|
2
|
2016-11-10 23:36:44 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
2016-11-02 05:05:43 +03:00
|
|
|
},
|
2016-12-02 00:03:52 +03:00
|
|
|
"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"
|
2016-11-02 05:05:43 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"span": {
|
2016-11-10 23:36:44 +03:00
|
|
|
"delete": {
|
2016-11-02 05:05:43 +03:00
|
|
|
"start": [
|
2016-12-02 00:03:52 +03:00
|
|
|
12,
|
|
|
|
7
|
2016-11-02 05:05:43 +03:00
|
|
|
],
|
|
|
|
"end": [
|
2016-11-11 00:19:53 +03:00
|
|
|
12,
|
2016-12-02 00:03:52 +03:00
|
|
|
8
|
2016-11-02 05:05:43 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2017-01-06 01:08:28 +03:00
|
|
|
"summary": "Deleted the 'i' identifier in the main function of the 'main' module"
|
2016-11-02 05:05:43 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"span": {
|
2016-11-10 23:36:44 +03:00
|
|
|
"delete": {
|
2016-11-02 05:05:43 +03:00
|
|
|
"start": [
|
2016-12-02 00:03:52 +03:00
|
|
|
12,
|
|
|
|
11
|
2016-11-02 05:05:43 +03:00
|
|
|
],
|
|
|
|
"end": [
|
2016-12-02 00:03:52 +03:00
|
|
|
12,
|
|
|
|
13
|
2016-11-02 05:05:43 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2016-12-02 00:03:52 +03:00
|
|
|
"summary": "Deleted '10' in the main function of the 'main' module"
|
2016-11-02 05:05:43 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"span": {
|
2016-11-10 23:36:44 +03:00
|
|
|
"delete": {
|
2016-11-02 05:05:43 +03:00
|
|
|
"start": [
|
2016-12-02 00:03:52 +03:00
|
|
|
12,
|
|
|
|
15
|
2016-11-02 05:05:43 +03:00
|
|
|
],
|
|
|
|
"end": [
|
2016-11-11 00:19:53 +03:00
|
|
|
12,
|
2016-12-02 00:03:52 +03:00
|
|
|
16
|
2016-11-02 05:05:43 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2016-12-02 00:03:52 +03:00
|
|
|
"summary": "Deleted the 'i' identifier in the main function of the 'main' module"
|
2016-11-02 05:05:43 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"span": {
|
|
|
|
"insert": {
|
|
|
|
"start": [
|
2016-12-02 00:03:52 +03:00
|
|
|
16,
|
|
|
|
7
|
2016-11-02 05:05:43 +03:00
|
|
|
],
|
|
|
|
"end": [
|
2016-11-11 00:19:53 +03:00
|
|
|
16,
|
2016-12-02 00:03:52 +03:00
|
|
|
8
|
2016-11-02 05:05:43 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2017-01-06 01:08:28 +03:00
|
|
|
"summary": "Added the 'i' identifier in the main function of the 'main' module"
|
2016-11-02 05:05:43 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"span": {
|
|
|
|
"insert": {
|
|
|
|
"start": [
|
2016-12-02 00:03:52 +03:00
|
|
|
16,
|
|
|
|
11
|
2016-11-02 05:05:43 +03:00
|
|
|
],
|
|
|
|
"end": [
|
2016-12-02 00:03:52 +03:00
|
|
|
16,
|
|
|
|
13
|
2016-11-02 05:05:43 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2016-12-02 00:03:52 +03:00
|
|
|
"summary": "Added '10' in the main function of the 'main' module"
|
2016-11-02 05:05:43 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"span": {
|
2016-12-02 00:03:52 +03:00
|
|
|
"insert": {
|
2016-11-02 05:05:43 +03:00
|
|
|
"start": [
|
2016-12-02 00:03:52 +03:00
|
|
|
16,
|
|
|
|
15
|
2016-11-02 05:05:43 +03:00
|
|
|
],
|
|
|
|
"end": [
|
2016-12-02 00:03:52 +03:00
|
|
|
16,
|
|
|
|
16
|
2016-11-02 05:05:43 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2016-12-02 00:03:52 +03:00
|
|
|
"summary": "Added the 'i' identifier in the main function of the 'main' module"
|
2016-11-02 05:05:43 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"span": {
|
2016-11-10 23:36:44 +03:00
|
|
|
"delete": {
|
2016-11-02 05:05:43 +03:00
|
|
|
"start": [
|
2016-12-02 00:03:52 +03:00
|
|
|
20,
|
|
|
|
5
|
2016-11-02 05:05:43 +03:00
|
|
|
],
|
|
|
|
"end": [
|
2016-12-02 00:03:52 +03:00
|
|
|
20,
|
|
|
|
6
|
2016-11-02 05:05:43 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2016-12-02 00:03:52 +03:00
|
|
|
"summary": "Deleted the 'x' identifier in the main function of the 'main' module"
|
2016-11-02 05:05:43 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"span": {
|
2016-11-10 23:36:44 +03:00
|
|
|
"delete": {
|
2016-11-02 05:05:43 +03:00
|
|
|
"start": [
|
2016-12-02 00:03:52 +03:00
|
|
|
20,
|
|
|
|
16
|
2016-11-02 05:05:43 +03:00
|
|
|
],
|
|
|
|
"end": [
|
2016-11-11 00:19:53 +03:00
|
|
|
20,
|
2016-12-02 00:03:52 +03:00
|
|
|
17
|
2016-11-02 05:05:43 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2016-12-02 00:03:52 +03:00
|
|
|
"summary": "Deleted the 'y' identifier in the main function of the 'main' module"
|
2016-11-10 23:36:44 +03:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"errors": {}
|
|
|
|
},
|
|
|
|
"filePaths": [
|
|
|
|
"for-statements.go"
|
|
|
|
],
|
2016-11-11 00:19:53 +03:00
|
|
|
"patch": [
|
|
|
|
"diff --git a/for-statements.go b/for-statements.go",
|
2016-12-02 00:03:52 +03:00
|
|
|
"index 66e5f7a..4099658 100644",
|
2016-11-11 00:19:53 +03:00
|
|
|
"--- a/for-statements.go",
|
|
|
|
"+++ b/for-statements.go",
|
2016-12-02 00:03:52 +03:00
|
|
|
"@@ -1,23 +1,23 @@",
|
|
|
|
" package main",
|
|
|
|
" ",
|
|
|
|
" func main() {",
|
2016-11-11 00:19:53 +03:00
|
|
|
"- 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",
|
|
|
|
" }"
|
|
|
|
],
|
2016-11-10 23:36:44 +03:00
|
|
|
"gitDir": "test/corpus/repos/go",
|
2017-01-11 00:21:35 +03:00
|
|
|
"shas": "49262e6046551f21fb4cd6e9060b8bbd29c40b7b..d3b7a0e5b9da9c2fa7d7025cdf25e1f6a4eab36a"
|
2016-11-10 23:36:44 +03:00
|
|
|
}
|
|
|
|
,{
|
|
|
|
"testCaseDescription": "go-for-statements-delete-replacement-test",
|
|
|
|
"expectedResult": {
|
|
|
|
"changes": {
|
|
|
|
"for-statements.go": [
|
2016-11-02 05:05:43 +03:00
|
|
|
{
|
|
|
|
"span": {
|
2016-12-02 00:03:52 +03:00
|
|
|
"replace": [
|
|
|
|
{
|
|
|
|
"start": [
|
|
|
|
8,
|
|
|
|
1
|
|
|
|
],
|
|
|
|
"end": [
|
|
|
|
11,
|
|
|
|
2
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"start": [
|
|
|
|
8,
|
|
|
|
1
|
|
|
|
],
|
|
|
|
"end": [
|
|
|
|
11,
|
|
|
|
2
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
2016-11-02 05:05:43 +03:00
|
|
|
},
|
2016-12-02 00:03:52 +03:00
|
|
|
"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"
|
2016-11-02 05:05:43 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"span": {
|
2016-11-03 01:46:48 +03:00
|
|
|
"insert": {
|
2016-11-02 05:05:43 +03:00
|
|
|
"start": [
|
2016-12-02 00:03:52 +03:00
|
|
|
12,
|
|
|
|
7
|
2016-11-02 05:05:43 +03:00
|
|
|
],
|
|
|
|
"end": [
|
2016-12-02 00:03:52 +03:00
|
|
|
12,
|
|
|
|
8
|
2016-11-02 05:05:43 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2017-01-06 01:08:28 +03:00
|
|
|
"summary": "Added the 'i' identifier in the main function of the 'main' module"
|
2016-11-02 05:05:43 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"span": {
|
2016-11-03 01:46:48 +03:00
|
|
|
"insert": {
|
2016-11-02 05:05:43 +03:00
|
|
|
"start": [
|
2016-12-02 00:03:52 +03:00
|
|
|
12,
|
|
|
|
11
|
2016-11-02 05:05:43 +03:00
|
|
|
],
|
|
|
|
"end": [
|
2016-12-02 00:03:52 +03:00
|
|
|
12,
|
|
|
|
13
|
2016-11-02 05:05:43 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2016-12-02 00:03:52 +03:00
|
|
|
"summary": "Added '10' in the main function of the 'main' module"
|
2016-11-02 05:05:43 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"span": {
|
2016-11-03 01:46:48 +03:00
|
|
|
"insert": {
|
2016-11-02 05:05:43 +03:00
|
|
|
"start": [
|
2016-12-02 00:03:52 +03:00
|
|
|
12,
|
|
|
|
15
|
2016-11-02 05:05:43 +03:00
|
|
|
],
|
|
|
|
"end": [
|
2016-12-02 00:03:52 +03:00
|
|
|
12,
|
|
|
|
16
|
2016-11-02 05:05:43 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2016-12-02 00:03:52 +03:00
|
|
|
"summary": "Added the 'i' identifier in the main function of the 'main' module"
|
2016-11-02 05:05:43 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"span": {
|
2016-12-02 00:03:52 +03:00
|
|
|
"delete": {
|
2016-11-02 05:05:43 +03:00
|
|
|
"start": [
|
2016-12-02 00:03:52 +03:00
|
|
|
16,
|
|
|
|
7
|
2016-11-02 05:05:43 +03:00
|
|
|
],
|
|
|
|
"end": [
|
2016-12-02 00:03:52 +03:00
|
|
|
16,
|
|
|
|
8
|
2016-11-02 05:05:43 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2017-01-06 01:08:28 +03:00
|
|
|
"summary": "Deleted the 'i' identifier in the main function of the 'main' module"
|
2016-11-03 01:46:48 +03:00
|
|
|
},
|
2016-11-02 05:05:43 +03:00
|
|
|
{
|
|
|
|
"span": {
|
2016-11-10 23:36:44 +03:00
|
|
|
"delete": {
|
2016-11-02 05:05:43 +03:00
|
|
|
"start": [
|
2016-12-02 00:03:52 +03:00
|
|
|
16,
|
|
|
|
11
|
2016-11-02 05:05:43 +03:00
|
|
|
],
|
|
|
|
"end": [
|
2016-12-02 00:03:52 +03:00
|
|
|
16,
|
|
|
|
13
|
2016-11-02 05:05:43 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2016-12-02 00:03:52 +03:00
|
|
|
"summary": "Deleted '10' in the main function of the 'main' module"
|
2016-11-02 05:05:43 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"span": {
|
2016-11-10 23:36:44 +03:00
|
|
|
"delete": {
|
2016-11-02 05:05:43 +03:00
|
|
|
"start": [
|
2016-12-02 00:03:52 +03:00
|
|
|
16,
|
|
|
|
15
|
2016-11-02 05:05:43 +03:00
|
|
|
],
|
|
|
|
"end": [
|
2016-12-02 00:03:52 +03:00
|
|
|
16,
|
|
|
|
16
|
2016-11-02 05:05:43 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2016-12-02 00:03:52 +03:00
|
|
|
"summary": "Deleted the 'i' identifier in the main function of the 'main' module"
|
2016-11-02 05:05:43 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"span": {
|
2016-12-02 00:03:52 +03:00
|
|
|
"insert": {
|
2016-11-02 05:05:43 +03:00
|
|
|
"start": [
|
2016-12-02 00:03:52 +03:00
|
|
|
20,
|
|
|
|
5
|
2016-11-02 05:05:43 +03:00
|
|
|
],
|
|
|
|
"end": [
|
2016-12-02 00:03:52 +03:00
|
|
|
20,
|
|
|
|
6
|
2016-11-02 05:05:43 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2016-12-02 00:03:52 +03:00
|
|
|
"summary": "Added the 'x' identifier in the main function of the 'main' module"
|
2016-11-02 05:05:43 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"span": {
|
2016-12-02 00:03:52 +03:00
|
|
|
"insert": {
|
2016-11-02 05:05:43 +03:00
|
|
|
"start": [
|
2016-12-02 00:03:52 +03:00
|
|
|
20,
|
|
|
|
16
|
2016-11-02 05:05:43 +03:00
|
|
|
],
|
|
|
|
"end": [
|
2016-12-02 00:03:52 +03:00
|
|
|
20,
|
|
|
|
17
|
2016-11-02 05:05:43 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2016-12-02 00:03:52 +03:00
|
|
|
"summary": "Added the 'y' identifier in the main function of the 'main' module"
|
2016-11-03 01:46:48 +03:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"errors": {}
|
|
|
|
},
|
|
|
|
"filePaths": [
|
|
|
|
"for-statements.go"
|
|
|
|
],
|
2016-11-11 00:19:53 +03:00
|
|
|
"patch": [
|
|
|
|
"diff --git a/for-statements.go b/for-statements.go",
|
2016-12-02 00:03:52 +03:00
|
|
|
"index 4099658..66e5f7a 100644",
|
2016-11-11 00:19:53 +03:00
|
|
|
"--- a/for-statements.go",
|
|
|
|
"+++ b/for-statements.go",
|
2016-12-02 00:03:52 +03:00
|
|
|
"@@ -1,23 +1,23 @@",
|
|
|
|
" package main",
|
|
|
|
" ",
|
|
|
|
" func main() {",
|
2016-11-11 00:19:53 +03:00
|
|
|
"- for ;; {",
|
2016-12-02 00:03:52 +03:00
|
|
|
"+ for {",
|
2016-11-11 00:19:53 +03:00
|
|
|
" a()",
|
|
|
|
" goto loop",
|
|
|
|
" }",
|
2016-12-02 00:03:52 +03:00
|
|
|
"-for x := range y {",
|
|
|
|
"+for i := 0; i < 5; i++ {",
|
2016-11-11 00:19:53 +03:00
|
|
|
" a()",
|
|
|
|
" break loop",
|
|
|
|
" }",
|
2016-12-02 00:03:52 +03:00
|
|
|
"-for ;; {",
|
|
|
|
"+for ; i < 10; i++ {",
|
2016-11-11 00:19:53 +03:00
|
|
|
" a()",
|
|
|
|
" continue loop2",
|
|
|
|
" }",
|
2016-12-02 00:03:52 +03:00
|
|
|
"-for ; i < 10; i++ {",
|
|
|
|
"+for ;; {",
|
2016-11-11 00:19:53 +03:00
|
|
|
" a()",
|
|
|
|
" continue",
|
|
|
|
" }",
|
2016-12-02 00:03:52 +03:00
|
|
|
"-for {",
|
|
|
|
"+for x := range y {",
|
2016-11-11 00:19:53 +03:00
|
|
|
" a(x)",
|
|
|
|
" break",
|
|
|
|
" }"
|
|
|
|
],
|
2016-11-03 01:46:48 +03:00
|
|
|
"gitDir": "test/corpus/repos/go",
|
2017-01-11 00:21:35 +03:00
|
|
|
"shas": "d3b7a0e5b9da9c2fa7d7025cdf25e1f6a4eab36a..ce74bd2dc813dc9729c1a80f521142c4de41a83d"
|
2016-11-03 01:46:48 +03:00
|
|
|
}
|
|
|
|
,{
|
2016-12-02 00:03:52 +03:00
|
|
|
"testCaseDescription": "go-for-statements-delete-insert-test",
|
2016-11-03 01:46:48 +03:00
|
|
|
"expectedResult": {
|
|
|
|
"changes": {
|
|
|
|
"for-statements.go": [
|
2016-11-02 05:05:43 +03:00
|
|
|
{
|
|
|
|
"span": {
|
|
|
|
"delete": {
|
|
|
|
"start": [
|
2016-12-02 00:03:52 +03:00
|
|
|
4,
|
2016-11-10 23:36:44 +03:00
|
|
|
2
|
2016-11-02 05:05:43 +03:00
|
|
|
],
|
|
|
|
"end": [
|
2016-12-02 00:03:52 +03:00
|
|
|
7,
|
2016-11-10 23:36:44 +03:00
|
|
|
2
|
2016-11-02 05:05:43 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2016-12-02 00:03:52 +03:00
|
|
|
"summary": "Deleted the 'for {\na()\ngoto loop\n}' for statement in the main function of the 'main' module"
|
2016-11-02 05:05:43 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"span": {
|
|
|
|
"delete": {
|
|
|
|
"start": [
|
2016-12-02 00:03:52 +03:00
|
|
|
8,
|
2016-11-03 01:46:48 +03:00
|
|
|
1
|
2016-11-02 05:05:43 +03:00
|
|
|
],
|
|
|
|
"end": [
|
2016-12-02 00:03:52 +03:00
|
|
|
11,
|
2016-11-10 23:36:44 +03:00
|
|
|
2
|
2016-11-02 05:05:43 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2016-12-02 00:03:52 +03:00
|
|
|
"summary": "Deleted the 'i := 0; i < 5; i++' for statement in the main function of the 'main' module"
|
2016-11-02 05:05:43 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"span": {
|
|
|
|
"delete": {
|
|
|
|
"start": [
|
2016-12-02 00:03:52 +03:00
|
|
|
12,
|
2016-11-02 05:05:43 +03:00
|
|
|
1
|
|
|
|
],
|
|
|
|
"end": [
|
2016-12-02 00:03:52 +03:00
|
|
|
15,
|
2016-11-10 23:36:44 +03:00
|
|
|
2
|
2016-11-02 05:05:43 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2016-12-02 00:03:52 +03:00
|
|
|
"summary": "Deleted the 'i < 10; i++' for statement in the main function of the 'main' module"
|
2016-11-02 05:05:43 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"span": {
|
|
|
|
"delete": {
|
|
|
|
"start": [
|
2016-12-02 00:03:52 +03:00
|
|
|
16,
|
2016-11-03 01:46:48 +03:00
|
|
|
1
|
2016-11-02 05:05:43 +03:00
|
|
|
],
|
|
|
|
"end": [
|
2016-12-02 00:03:52 +03:00
|
|
|
19,
|
2016-11-10 23:36:44 +03:00
|
|
|
2
|
2016-11-02 05:05:43 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2016-12-02 00:03:52 +03:00
|
|
|
"summary": "Deleted the 'for ;; {\na()\ncontinue\n}' for statement in the main function of the 'main' module"
|
2016-11-02 05:05:43 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"span": {
|
|
|
|
"delete": {
|
|
|
|
"start": [
|
2016-12-02 00:03:52 +03:00
|
|
|
20,
|
2016-11-03 01:46:48 +03:00
|
|
|
1
|
2016-11-02 05:05:43 +03:00
|
|
|
],
|
|
|
|
"end": [
|
2016-12-02 00:03:52 +03:00
|
|
|
23,
|
2016-11-03 01:46:48 +03:00
|
|
|
2
|
2016-11-02 05:05:43 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2016-12-02 00:03:52 +03:00
|
|
|
"summary": "Deleted the 'x := range y' for statement in the main function of the 'main' module"
|
2016-11-02 05:05:43 +03:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"errors": {}
|
|
|
|
},
|
|
|
|
"filePaths": [
|
|
|
|
"for-statements.go"
|
|
|
|
],
|
2016-11-11 00:19:53 +03:00
|
|
|
"patch": [
|
|
|
|
"diff --git a/for-statements.go b/for-statements.go",
|
2016-12-02 00:03:52 +03:00
|
|
|
"index 66e5f7a..7905807 100644",
|
2016-11-11 00:19:53 +03:00
|
|
|
"--- a/for-statements.go",
|
|
|
|
"+++ b/for-statements.go",
|
2016-12-02 00:03:52 +03:00
|
|
|
"@@ -1,24 +1,5 @@",
|
|
|
|
" package main",
|
|
|
|
" ",
|
|
|
|
" func main() {",
|
2016-11-11 00:19:53 +03:00
|
|
|
"- 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",
|
|
|
|
"-}",
|
2016-12-02 00:03:52 +03:00
|
|
|
"+",
|
|
|
|
" }"
|
2016-11-11 00:19:53 +03:00
|
|
|
],
|
2016-11-02 05:05:43 +03:00
|
|
|
"gitDir": "test/corpus/repos/go",
|
2017-01-11 00:21:35 +03:00
|
|
|
"shas": "ce74bd2dc813dc9729c1a80f521142c4de41a83d..e93bda2d92cc10d2727a26b36865be786d9b17f6"
|
2016-11-02 05:05:43 +03:00
|
|
|
}
|
|
|
|
,{
|
2016-12-02 00:03:52 +03:00
|
|
|
"testCaseDescription": "go-for-statements-teardown-test",
|
2016-11-02 05:05:43 +03:00
|
|
|
"expectedResult": {
|
|
|
|
"changes": {
|
|
|
|
"for-statements.go": [
|
|
|
|
{
|
|
|
|
"span": {
|
2016-11-11 00:19:53 +03:00
|
|
|
"delete": {
|
|
|
|
"start": [
|
|
|
|
1,
|
|
|
|
1
|
|
|
|
],
|
|
|
|
"end": [
|
2016-12-02 00:03:52 +03:00
|
|
|
6,
|
2016-11-11 00:19:53 +03:00
|
|
|
1
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2016-12-02 00:03:52 +03:00
|
|
|
"summary": "Deleted the 'main' module"
|
2016-11-02 05:05:43 +03:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"errors": {}
|
|
|
|
},
|
|
|
|
"filePaths": [
|
|
|
|
"for-statements.go"
|
|
|
|
],
|
2016-11-11 00:19:53 +03:00
|
|
|
"patch": [
|
|
|
|
"diff --git a/for-statements.go b/for-statements.go",
|
2016-12-02 00:03:52 +03:00
|
|
|
"index 7905807..e69de29 100644",
|
2016-11-11 00:19:53 +03:00
|
|
|
"--- a/for-statements.go",
|
|
|
|
"+++ b/for-statements.go",
|
2016-12-02 00:03:52 +03:00
|
|
|
"@@ -1,5 +0,0 @@",
|
|
|
|
"-package main",
|
|
|
|
"-",
|
|
|
|
"-func main() {",
|
|
|
|
"-",
|
2016-11-11 00:19:53 +03:00
|
|
|
"-}"
|
|
|
|
],
|
2016-11-02 05:05:43 +03:00
|
|
|
"gitDir": "test/corpus/repos/go",
|
2017-01-11 00:21:35 +03:00
|
|
|
"shas": "e93bda2d92cc10d2727a26b36865be786d9b17f6..eb604dc37d1dad7626dcb78e1d858f09877e2542"
|
2016-11-02 05:05:43 +03:00
|
|
|
}]
|