mirror of
https://github.com/github/semantic.git
synced 2024-12-23 14:54:16 +03:00
723 lines
22 KiB
JSON
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": "242a94db5745d7e1c4b448f6253ca65bfa2b9821..cc0d1845575f9df74e0694efca6da9de1f47e7d1"
|
|
}
|
|
,{
|
|
"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": "cc0d1845575f9df74e0694efca6da9de1f47e7d1..49262e6046551f21fb4cd6e9060b8bbd29c40b7b"
|
|
}
|
|
,{
|
|
"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 the '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 the '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": "49262e6046551f21fb4cd6e9060b8bbd29c40b7b..d3b7a0e5b9da9c2fa7d7025cdf25e1f6a4eab36a"
|
|
}
|
|
,{
|
|
"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 the '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 the '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": "d3b7a0e5b9da9c2fa7d7025cdf25e1f6a4eab36a..ce74bd2dc813dc9729c1a80f521142c4de41a83d"
|
|
}
|
|
,{
|
|
"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": "ce74bd2dc813dc9729c1a80f521142c4de41a83d..e93bda2d92cc10d2727a26b36865be786d9b17f6"
|
|
}
|
|
,{
|
|
"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": "e93bda2d92cc10d2727a26b36865be786d9b17f6..eb604dc37d1dad7626dcb78e1d858f09877e2542"
|
|
}]
|