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": "8642fc253531fa66c43d2c36b000da8d4ed37ad0..ade461b2d12cbf5b4fb9c710f91c9d76286f29b2"
|
|
}
|
|
,{
|
|
"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": "ade461b2d12cbf5b4fb9c710f91c9d76286f29b2..c4449b0bcffb478b311f1faab0187d06cc53dba8"
|
|
}
|
|
,{
|
|
"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": "c4449b0bcffb478b311f1faab0187d06cc53dba8..dc77543efe6aea5051c9271ac8c135a7f490e021"
|
|
}
|
|
,{
|
|
"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": "dc77543efe6aea5051c9271ac8c135a7f490e021..d717ea85744e35301b51c60632dfe50ab84fa649"
|
|
}
|
|
,{
|
|
"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": "d717ea85744e35301b51c60632dfe50ab84fa649..726b2eb84007600c7f4dd0903252b095d8b7d3cd"
|
|
}
|
|
,{
|
|
"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": "726b2eb84007600c7f4dd0903252b095d8b7d3cd..5ee82082a46c778d2d73f23d2d266ea19676839a"
|
|
}]
|