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",
|
2016-12-02 00:03:52 +03:00
|
|
|
"shas": "678323dd89ca74cd5fe06c4efdc8ec7abe45b581..458188dab2858f9fc6b0d6955ad5cd65c6a7f2e5"
|
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",
|
2016-12-02 00:03:52 +03:00
|
|
|
"shas": "458188dab2858f9fc6b0d6955ad5cd65c6a7f2e5..f86745509a4baa05a4bd6b2c8384ae4da2c0f7d4"
|
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
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2016-12-02 00:03:52 +03:00
|
|
|
"summary": "Deleted '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
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2016-12-02 00:03:52 +03:00
|
|
|
"summary": "Added '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",
|
2016-12-02 00:03:52 +03:00
|
|
|
"shas": "f86745509a4baa05a4bd6b2c8384ae4da2c0f7d4..d28754ec27eec808434ebc246d952065b07b9daf"
|
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
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2016-12-02 00:03:52 +03:00
|
|
|
"summary": "Added '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
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2016-12-02 00:03:52 +03:00
|
|
|
"summary": "Deleted '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",
|
2016-12-02 00:03:52 +03:00
|
|
|
"shas": "d28754ec27eec808434ebc246d952065b07b9daf..5b574c3f53c7280d575bac8570cc7ddd8b3ddd23"
|
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",
|
2016-12-02 00:03:52 +03:00
|
|
|
"shas": "5b574c3f53c7280d575bac8570cc7ddd8b3ddd23..417cf9ad568c1eb652c601c65c77f2f1d845ca33"
|
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",
|
2016-12-02 00:03:52 +03:00
|
|
|
"shas": "417cf9ad568c1eb652c601c65c77f2f1d845ca33..1854d5f55250893392d152736636fdb9dd9b51e8"
|
2016-11-02 05:05:43 +03:00
|
|
|
}]
|