mirror of
https://github.com/github/semantic.git
synced 2024-12-23 14:54:16 +03:00
1197 lines
36 KiB
JSON
1197 lines
36 KiB
JSON
[{
|
|
"testCaseDescription": "go-for-statements-insert-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"for-statements.go": [
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
1,
|
|
2
|
|
],
|
|
"end": [
|
|
4,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'for {\na()\ngoto loop\n}' for statement"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
5,
|
|
1
|
|
],
|
|
"end": [
|
|
8,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'i := 0; i < 5; i++' for statement"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
9,
|
|
1
|
|
],
|
|
"end": [
|
|
12,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'i < 10; i++' for statement"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
13,
|
|
1
|
|
],
|
|
"end": [
|
|
16,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'for ;; {\na()\ncontinue\n}' for statement"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
17,
|
|
1
|
|
],
|
|
"end": [
|
|
20,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'x := range y' for statement"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"for-statements.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/for-statements.go b/for-statements.go",
|
|
"index e69de29..cf40a00 100644",
|
|
"--- a/for-statements.go",
|
|
"+++ b/for-statements.go",
|
|
"@@ -0,0 +1,20 @@",
|
|
"+ 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": "5b7b3301375ff5a3c26fc52ca1b4c4b5adf72c36..9e2d294258800c7665846cff027c550d3e30890c"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-for-statements-replacement-insert-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"for-statements.go": [
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
1,
|
|
2
|
|
],
|
|
"end": [
|
|
4,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'for ;; {\na()\ngoto loop\n}' for statement"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
5,
|
|
1
|
|
],
|
|
"end": [
|
|
8,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'x := range y' for statement"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
9,
|
|
1
|
|
],
|
|
"end": [
|
|
12,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'for ;; {\na()\ncontinue loop2\n}' for statement"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
13,
|
|
1
|
|
],
|
|
"end": [
|
|
16,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'i < 10; i++' for statement"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
17,
|
|
1
|
|
],
|
|
"end": [
|
|
20,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'for {\na(x)\nbreak\n}' for statement"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
21,
|
|
2
|
|
],
|
|
"end": [
|
|
24,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'for {\na()\ngoto loop\n}' for statement"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
25,
|
|
1
|
|
],
|
|
"end": [
|
|
28,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'i := 0; i < 5; i++' for statement"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
29,
|
|
1
|
|
],
|
|
"end": [
|
|
32,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'i < 10; i++' for statement"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
33,
|
|
1
|
|
],
|
|
"end": [
|
|
36,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'for ;; {\na()\ncontinue\n}' for statement"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
37,
|
|
1
|
|
],
|
|
"end": [
|
|
40,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'x := range y' for statement"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"for-statements.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/for-statements.go b/for-statements.go",
|
|
"index cf40a00..4fd7ac5 100644",
|
|
"--- a/for-statements.go",
|
|
"+++ b/for-statements.go",
|
|
"@@ -1,3 +1,43 @@",
|
|
"+ for ;; {",
|
|
"+a()",
|
|
"+goto loop",
|
|
"+}",
|
|
"+for x := range y {",
|
|
"+a()",
|
|
"+break loop",
|
|
"+}",
|
|
"+for ;; {",
|
|
"+a()",
|
|
"+continue loop2",
|
|
"+}",
|
|
"+for ; i < 10; i++ {",
|
|
"+a()",
|
|
"+continue",
|
|
"+}",
|
|
"+for {",
|
|
"+a(x)",
|
|
"+break",
|
|
"+}",
|
|
"+ 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",
|
|
"+}",
|
|
" for {",
|
|
" a()",
|
|
" goto loop"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "9e2d294258800c7665846cff027c550d3e30890c..4630151d75f6698696939c0e227d65066baa36c6"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-for-statements-delete-insert-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"for-statements.go": [
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
5,
|
|
1
|
|
],
|
|
"end": [
|
|
8,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'i := 0; i < 5; i++' for statement"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
9,
|
|
1
|
|
],
|
|
"end": [
|
|
12,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'i < 10; i++' for statement"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
13,
|
|
1
|
|
],
|
|
"end": [
|
|
16,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'for ;; {\na()\ncontinue\n}' for statement"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
6,
|
|
1
|
|
],
|
|
"end": [
|
|
6,
|
|
4
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
18,
|
|
1
|
|
],
|
|
"end": [
|
|
18,
|
|
2
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'a()' function call with the 'a' identifier"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
7,
|
|
7
|
|
],
|
|
"end": [
|
|
7,
|
|
11
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
19,
|
|
1
|
|
],
|
|
"end": [
|
|
19,
|
|
6
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'loop' identifier with the 'break' break_statement"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
9,
|
|
1
|
|
],
|
|
"end": [
|
|
12,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'for ;; {\na()\ncontinue loop2\n}' for statement"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
13,
|
|
1
|
|
],
|
|
"end": [
|
|
16,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'i < 10; i++' for statement"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
17,
|
|
1
|
|
],
|
|
"end": [
|
|
20,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'for {\na(x)\nbreak\n}' for statement"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"for-statements.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/for-statements.go b/for-statements.go",
|
|
"index 4fd7ac5..ac76ef3 100644",
|
|
"--- a/for-statements.go",
|
|
"+++ b/for-statements.go",
|
|
"@@ -1,20 +1,20 @@",
|
|
"- 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": "4630151d75f6698696939c0e227d65066baa36c6..ce57afdd1e316990e8b1f0e9688060bf912c7df3"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-for-statements-replacement-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"for-statements.go": [
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
5,
|
|
1
|
|
],
|
|
"end": [
|
|
8,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'x := range y' for statement"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
9,
|
|
1
|
|
],
|
|
"end": [
|
|
12,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'for ;; {\na()\ncontinue loop2\n}' for statement"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
13,
|
|
1
|
|
],
|
|
"end": [
|
|
16,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'i < 10; i++' for statement"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
17,
|
|
1
|
|
],
|
|
"end": [
|
|
20,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'for {\na(x)\nbreak\n}' for statement"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
5,
|
|
1
|
|
],
|
|
"end": [
|
|
8,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'i := 0; i < 5; i++' for statement"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
9,
|
|
1
|
|
],
|
|
"end": [
|
|
12,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'i < 10; i++' for statement"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
13,
|
|
1
|
|
],
|
|
"end": [
|
|
16,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'for ;; {\na()\ncontinue\n}' for statement"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
17,
|
|
1
|
|
],
|
|
"end": [
|
|
20,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'x := range y' for statement"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"for-statements.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/for-statements.go b/for-statements.go",
|
|
"index ac76ef3..4fd7ac5 100644",
|
|
"--- a/for-statements.go",
|
|
"+++ b/for-statements.go",
|
|
"@@ -1,20 +1,20 @@",
|
|
"- 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": "ce57afdd1e316990e8b1f0e9688060bf912c7df3..beea16551f0323eb74c7dd4f3930141e72d5bd87"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-for-statements-delete-replacement-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"for-statements.go": [
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
1,
|
|
2
|
|
],
|
|
"end": [
|
|
4,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'for ;; {\na()\ngoto loop\n}' for statement"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
5,
|
|
1
|
|
],
|
|
"end": [
|
|
8,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'x := range y' for statement"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
9,
|
|
1
|
|
],
|
|
"end": [
|
|
12,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'for ;; {\na()\ncontinue loop2\n}' for statement"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
13,
|
|
1
|
|
],
|
|
"end": [
|
|
16,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'i < 10; i++' for statement"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
17,
|
|
1
|
|
],
|
|
"end": [
|
|
20,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'for {\na(x)\nbreak\n}' for statement"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
25,
|
|
1
|
|
],
|
|
"end": [
|
|
28,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'x := range y' for statement"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
29,
|
|
1
|
|
],
|
|
"end": [
|
|
32,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'for ;; {\na()\ncontinue loop2\n}' for statement"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
33,
|
|
1
|
|
],
|
|
"end": [
|
|
36,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'i < 10; i++' for statement"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
37,
|
|
1
|
|
],
|
|
"end": [
|
|
40,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'for {\na(x)\nbreak\n}' for statement"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
45,
|
|
1
|
|
],
|
|
"end": [
|
|
48,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'i := 0; i < 5; i++' for statement"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
49,
|
|
1
|
|
],
|
|
"end": [
|
|
52,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'i < 10; i++' for statement"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
53,
|
|
1
|
|
],
|
|
"end": [
|
|
56,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'for ;; {\na()\ncontinue\n}' for statement"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
57,
|
|
1
|
|
],
|
|
"end": [
|
|
60,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'x := range y' for statement"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"for-statements.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/for-statements.go b/for-statements.go",
|
|
"index 4fd7ac5..53849f8 100644",
|
|
"--- a/for-statements.go",
|
|
"+++ b/for-statements.go",
|
|
"@@ -1,23 +1,3 @@",
|
|
"- for ;; {",
|
|
"-a()",
|
|
"-goto loop",
|
|
"-}",
|
|
"-for x := range y {",
|
|
"-a()",
|
|
"-break loop",
|
|
"-}",
|
|
"-for ;; {",
|
|
"-a()",
|
|
"-continue loop2",
|
|
"-}",
|
|
"-for ; i < 10; i++ {",
|
|
"-a()",
|
|
"-continue",
|
|
"-}",
|
|
"-for {",
|
|
"-a(x)",
|
|
"-break",
|
|
"-}",
|
|
" for {",
|
|
" a()",
|
|
" goto loop",
|
|
"@@ -38,23 +18,23 @@ for x := range y {",
|
|
" a(x)",
|
|
" break",
|
|
" }",
|
|
"- 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": "beea16551f0323eb74c7dd4f3930141e72d5bd87..1508bc694fbb40431845c46a32c2b40d2f8912c7"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-for-statements-delete-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"for-statements.go": [
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
1,
|
|
2
|
|
],
|
|
"end": [
|
|
4,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'for {\na()\ngoto loop\n}' for statement"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
5,
|
|
1
|
|
],
|
|
"end": [
|
|
8,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'i := 0; i < 5; i++' for statement"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
9,
|
|
1
|
|
],
|
|
"end": [
|
|
12,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'i < 10; i++' for statement"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
13,
|
|
1
|
|
],
|
|
"end": [
|
|
16,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'for ;; {\na()\ncontinue\n}' for statement"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
17,
|
|
1
|
|
],
|
|
"end": [
|
|
20,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'x := range y' for statement"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"for-statements.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/for-statements.go b/for-statements.go",
|
|
"index 53849f8..c242f13 100644",
|
|
"--- a/for-statements.go",
|
|
"+++ b/for-statements.go",
|
|
"@@ -1,23 +1,3 @@",
|
|
"- 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",
|
|
"-}",
|
|
" for ;; {",
|
|
" a()",
|
|
" goto loop"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "1508bc694fbb40431845c46a32c2b40d2f8912c7..297ed8c04a9087636c15186d0e49ee15d2f72d79"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-for-statements-delete-rest-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"for-statements.go": [
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
1,
|
|
2
|
|
],
|
|
"end": [
|
|
4,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'for ;; {\na()\ngoto loop\n}' for statement"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
5,
|
|
1
|
|
],
|
|
"end": [
|
|
8,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'x := range y' for statement"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
9,
|
|
1
|
|
],
|
|
"end": [
|
|
12,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'for ;; {\na()\ncontinue loop2\n}' for statement"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
13,
|
|
1
|
|
],
|
|
"end": [
|
|
16,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'i < 10; i++' for statement"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
17,
|
|
1
|
|
],
|
|
"end": [
|
|
20,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'for {\na(x)\nbreak\n}' for statement"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"for-statements.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/for-statements.go b/for-statements.go",
|
|
"index c242f13..e69de29 100644",
|
|
"--- a/for-statements.go",
|
|
"+++ b/for-statements.go",
|
|
"@@ -1,20 +0,0 @@",
|
|
"- for ;; {",
|
|
"-a()",
|
|
"-goto loop",
|
|
"-}",
|
|
"-for x := range y {",
|
|
"-a()",
|
|
"-break loop",
|
|
"-}",
|
|
"-for ;; {",
|
|
"-a()",
|
|
"-continue loop2",
|
|
"-}",
|
|
"-for ; i < 10; i++ {",
|
|
"-a()",
|
|
"-continue",
|
|
"-}",
|
|
"-for {",
|
|
"-a(x)",
|
|
"-break",
|
|
"-}"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "297ed8c04a9087636c15186d0e49ee15d2f72d79..3ca56e2f308bdf1004479da38b6697b2e17e8572"
|
|
}]
|