2016-11-01 21:36:23 +03:00
|
|
|
[{
|
2016-12-02 00:03:52 +03:00
|
|
|
"testCaseDescription": "go-function-literals-setup-test",
|
2016-11-01 21:36:23 +03:00
|
|
|
"expectedResult": {
|
|
|
|
"changes": {
|
2016-11-02 21:37:30 +03:00
|
|
|
"function-literals.go": [
|
2016-11-01 21:36:23 +03:00
|
|
|
{
|
|
|
|
"span": {
|
|
|
|
"insert": {
|
|
|
|
"start": [
|
2016-11-11 00:19:53 +03:00
|
|
|
1,
|
2016-11-01 21:36:23 +03:00
|
|
|
1
|
|
|
|
],
|
|
|
|
"end": [
|
2016-12-02 00:03:52 +03:00
|
|
|
6,
|
|
|
|
1
|
2016-11-01 21:36:23 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2016-12-02 00:03:52 +03:00
|
|
|
"summary": "Added the 'main' module"
|
2016-11-01 21:36:23 +03:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"errors": {}
|
|
|
|
},
|
|
|
|
"filePaths": [
|
2016-11-02 21:37:30 +03:00
|
|
|
"function-literals.go"
|
2016-11-01 21:36:23 +03:00
|
|
|
],
|
2016-11-11 00:19:53 +03:00
|
|
|
"patch": [
|
|
|
|
"diff --git a/function-literals.go b/function-literals.go",
|
2016-12-02 00:03:52 +03:00
|
|
|
"index e69de29..7905807 100644",
|
2016-11-11 00:19:53 +03:00
|
|
|
"--- a/function-literals.go",
|
|
|
|
"+++ b/function-literals.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-01 21:36:23 +03:00
|
|
|
"gitDir": "test/corpus/repos/go",
|
2017-01-10 23:09:09 +03:00
|
|
|
"shas": "fed3f54df513dc6e5faff4d10a233dd6c9f0a200..3c9abf4f527fc75f4953598565c29109d06516c0"
|
2016-11-01 21:36:23 +03:00
|
|
|
}
|
|
|
|
,{
|
2016-12-02 00:03:52 +03:00
|
|
|
"testCaseDescription": "go-function-literals-insert-test",
|
2016-11-01 21:36:23 +03:00
|
|
|
"expectedResult": {
|
2016-12-07 23:41:28 +03:00
|
|
|
"changes": {
|
|
|
|
"function-literals.go": [
|
|
|
|
{
|
|
|
|
"span": {
|
|
|
|
"insert": {
|
|
|
|
"start": [
|
|
|
|
4,
|
2017-01-10 23:09:09 +03:00
|
|
|
7
|
2016-12-07 23:41:28 +03:00
|
|
|
],
|
|
|
|
"end": [
|
|
|
|
6,
|
|
|
|
2
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2017-01-10 23:09:09 +03:00
|
|
|
"summary": "Added the 's1' var assignment in the main function of the 'main' module"
|
2016-12-07 23:41:28 +03:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2016-11-01 21:36:23 +03:00
|
|
|
"errors": {}
|
|
|
|
},
|
|
|
|
"filePaths": [
|
2016-11-02 21:37:30 +03:00
|
|
|
"function-literals.go"
|
2016-11-01 21:36:23 +03:00
|
|
|
],
|
2016-11-11 00:19:53 +03:00
|
|
|
"patch": [
|
|
|
|
"diff --git a/function-literals.go b/function-literals.go",
|
2016-12-02 00:03:52 +03:00
|
|
|
"index 7905807..1f4ead9 100644",
|
2016-11-11 00:19:53 +03:00
|
|
|
"--- a/function-literals.go",
|
|
|
|
"+++ b/function-literals.go",
|
2016-12-02 00:03:52 +03:00
|
|
|
"@@ -1,5 +1,7 @@",
|
|
|
|
" package main",
|
|
|
|
" ",
|
|
|
|
" func main() {",
|
|
|
|
"-",
|
2016-11-11 00:19:53 +03:00
|
|
|
"+const s1 = func(s string) (int, int) {",
|
|
|
|
"+return 1, 2",
|
|
|
|
"+}",
|
|
|
|
" }"
|
|
|
|
],
|
2016-11-01 21:36:23 +03:00
|
|
|
"gitDir": "test/corpus/repos/go",
|
2017-01-10 23:09:09 +03:00
|
|
|
"shas": "3c9abf4f527fc75f4953598565c29109d06516c0..3872e808df9131009d82edf5d1632fe493a131d5"
|
2016-11-01 21:36:23 +03:00
|
|
|
}
|
|
|
|
,{
|
2016-11-02 21:37:30 +03:00
|
|
|
"testCaseDescription": "go-function-literals-replacement-test",
|
2016-11-01 21:36:23 +03:00
|
|
|
"expectedResult": {
|
2016-12-07 23:41:28 +03:00
|
|
|
"changes": {
|
|
|
|
"function-literals.go": [
|
|
|
|
{
|
|
|
|
"span": {
|
|
|
|
"replace": [
|
|
|
|
{
|
|
|
|
"start": [
|
|
|
|
4,
|
|
|
|
17
|
|
|
|
],
|
|
|
|
"end": [
|
|
|
|
4,
|
|
|
|
18
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"start": [
|
|
|
|
4,
|
|
|
|
17
|
|
|
|
],
|
|
|
|
"end": [
|
|
|
|
4,
|
|
|
|
18
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2017-01-10 23:09:09 +03:00
|
|
|
"summary": "Replaced the 's' identifier with the 'b' identifier in the s1 var assignment of the 'main' function"
|
2016-12-07 23:41:28 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"span": {
|
|
|
|
"replace": [
|
|
|
|
{
|
|
|
|
"start": [
|
|
|
|
4,
|
|
|
|
19
|
|
|
|
],
|
|
|
|
"end": [
|
|
|
|
4,
|
|
|
|
25
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"start": [
|
|
|
|
4,
|
|
|
|
19
|
|
|
|
],
|
|
|
|
"end": [
|
|
|
|
4,
|
|
|
|
22
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2017-01-10 23:09:09 +03:00
|
|
|
"summary": "Replaced the 'string' identifier with the 'int' identifier in the s1 var assignment of the 'main' function"
|
2016-12-07 23:41:28 +03:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2016-11-01 21:36:23 +03:00
|
|
|
"errors": {}
|
|
|
|
},
|
|
|
|
"filePaths": [
|
2016-11-02 21:37:30 +03:00
|
|
|
"function-literals.go"
|
2016-11-01 21:36:23 +03:00
|
|
|
],
|
2016-11-11 00:19:53 +03:00
|
|
|
"patch": [
|
|
|
|
"diff --git a/function-literals.go b/function-literals.go",
|
2016-12-02 00:03:52 +03:00
|
|
|
"index 1f4ead9..7b03466 100644",
|
2016-11-11 00:19:53 +03:00
|
|
|
"--- a/function-literals.go",
|
|
|
|
"+++ b/function-literals.go",
|
2016-12-02 00:03:52 +03:00
|
|
|
"@@ -1,7 +1,7 @@",
|
|
|
|
" package main",
|
|
|
|
" ",
|
|
|
|
" func main() {",
|
2016-11-11 00:19:53 +03:00
|
|
|
"-const s1 = func(s string) (int, int) {",
|
|
|
|
"+const s1 = func(b int) (string, string) {",
|
|
|
|
" return 1, 2",
|
|
|
|
" }",
|
2016-12-02 00:03:52 +03:00
|
|
|
" }"
|
2016-11-11 00:19:53 +03:00
|
|
|
],
|
2016-11-01 21:36:23 +03:00
|
|
|
"gitDir": "test/corpus/repos/go",
|
2017-01-10 23:09:09 +03:00
|
|
|
"shas": "3872e808df9131009d82edf5d1632fe493a131d5..5443f3462af5d6635c6de7ac9833a8f427702469"
|
2016-11-01 21:36:23 +03:00
|
|
|
}
|
|
|
|
,{
|
2016-11-02 21:37:30 +03:00
|
|
|
"testCaseDescription": "go-function-literals-delete-replacement-test",
|
2016-11-01 21:36:23 +03:00
|
|
|
"expectedResult": {
|
2016-12-07 23:41:28 +03:00
|
|
|
"changes": {
|
|
|
|
"function-literals.go": [
|
|
|
|
{
|
|
|
|
"span": {
|
|
|
|
"replace": [
|
|
|
|
{
|
|
|
|
"start": [
|
|
|
|
4,
|
|
|
|
17
|
|
|
|
],
|
|
|
|
"end": [
|
|
|
|
4,
|
|
|
|
18
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"start": [
|
|
|
|
4,
|
|
|
|
17
|
|
|
|
],
|
|
|
|
"end": [
|
|
|
|
4,
|
|
|
|
18
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2017-01-10 23:09:09 +03:00
|
|
|
"summary": "Replaced the 'b' identifier with the 's' identifier in the s1 var assignment of the 'main' function"
|
2016-12-07 23:41:28 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"span": {
|
|
|
|
"replace": [
|
|
|
|
{
|
|
|
|
"start": [
|
|
|
|
4,
|
|
|
|
19
|
|
|
|
],
|
|
|
|
"end": [
|
|
|
|
4,
|
|
|
|
22
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"start": [
|
|
|
|
4,
|
|
|
|
19
|
|
|
|
],
|
|
|
|
"end": [
|
|
|
|
4,
|
|
|
|
25
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2017-01-10 23:09:09 +03:00
|
|
|
"summary": "Replaced the 'int' identifier with the 'string' identifier in the s1 var assignment of the 'main' function"
|
2016-12-07 23:41:28 +03:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2016-11-01 21:36:23 +03:00
|
|
|
"errors": {}
|
|
|
|
},
|
|
|
|
"filePaths": [
|
2016-11-02 21:37:30 +03:00
|
|
|
"function-literals.go"
|
2016-11-01 21:36:23 +03:00
|
|
|
],
|
2016-11-11 00:19:53 +03:00
|
|
|
"patch": [
|
|
|
|
"diff --git a/function-literals.go b/function-literals.go",
|
2016-12-02 00:03:52 +03:00
|
|
|
"index 7b03466..1f4ead9 100644",
|
2016-11-11 00:19:53 +03:00
|
|
|
"--- a/function-literals.go",
|
|
|
|
"+++ b/function-literals.go",
|
2016-12-02 00:03:52 +03:00
|
|
|
"@@ -1,7 +1,7 @@",
|
|
|
|
" package main",
|
|
|
|
" ",
|
|
|
|
" func main() {",
|
2016-11-11 00:19:53 +03:00
|
|
|
"-const s1 = func(b int) (string, string) {",
|
2016-12-02 00:03:52 +03:00
|
|
|
"+const s1 = func(s string) (int, int) {",
|
2016-11-11 00:19:53 +03:00
|
|
|
" return 1, 2",
|
|
|
|
" }",
|
|
|
|
" }"
|
|
|
|
],
|
2016-11-01 21:36:23 +03:00
|
|
|
"gitDir": "test/corpus/repos/go",
|
2017-01-10 23:09:09 +03:00
|
|
|
"shas": "5443f3462af5d6635c6de7ac9833a8f427702469..0a813dbfcf2eee80a29b64940d6f7df0098431ec"
|
2016-11-01 21:36:23 +03:00
|
|
|
}
|
|
|
|
,{
|
2016-12-02 00:03:52 +03:00
|
|
|
"testCaseDescription": "go-function-literals-delete-insert-test",
|
2016-11-01 21:36:23 +03:00
|
|
|
"expectedResult": {
|
2016-12-07 23:41:28 +03:00
|
|
|
"changes": {
|
|
|
|
"function-literals.go": [
|
|
|
|
{
|
|
|
|
"span": {
|
|
|
|
"delete": {
|
|
|
|
"start": [
|
|
|
|
4,
|
2017-01-10 23:09:09 +03:00
|
|
|
7
|
2016-12-07 23:41:28 +03:00
|
|
|
],
|
|
|
|
"end": [
|
|
|
|
6,
|
|
|
|
2
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2017-01-10 23:09:09 +03:00
|
|
|
"summary": "Deleted the 's1' var assignment in the main function of the 'main' module"
|
2016-12-07 23:41:28 +03:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2016-11-01 21:36:23 +03:00
|
|
|
"errors": {}
|
|
|
|
},
|
|
|
|
"filePaths": [
|
2016-11-02 21:37:30 +03:00
|
|
|
"function-literals.go"
|
2016-11-01 21:36:23 +03:00
|
|
|
],
|
2016-11-11 00:19:53 +03:00
|
|
|
"patch": [
|
|
|
|
"diff --git a/function-literals.go b/function-literals.go",
|
2016-12-02 00:03:52 +03:00
|
|
|
"index 1f4ead9..7905807 100644",
|
2016-11-11 00:19:53 +03:00
|
|
|
"--- a/function-literals.go",
|
|
|
|
"+++ b/function-literals.go",
|
2016-12-02 00:03:52 +03:00
|
|
|
"@@ -1,7 +1,5 @@",
|
|
|
|
" package main",
|
|
|
|
" ",
|
|
|
|
" func main() {",
|
2016-11-11 00:19:53 +03:00
|
|
|
"-const s1 = func(s string) (int, int) {",
|
|
|
|
"-return 1, 2",
|
|
|
|
"-}",
|
2016-12-02 00:03:52 +03:00
|
|
|
"+",
|
2016-11-11 00:19:53 +03:00
|
|
|
" }"
|
|
|
|
],
|
2016-11-01 21:36:23 +03:00
|
|
|
"gitDir": "test/corpus/repos/go",
|
2017-01-10 23:09:09 +03:00
|
|
|
"shas": "0a813dbfcf2eee80a29b64940d6f7df0098431ec..b60e9e4bbc4eadc5871f18f472304a4f1abfbf32"
|
2016-11-01 21:36:23 +03:00
|
|
|
}
|
|
|
|
,{
|
2016-12-02 00:03:52 +03:00
|
|
|
"testCaseDescription": "go-function-literals-teardown-test",
|
2016-11-01 21:36:23 +03:00
|
|
|
"expectedResult": {
|
|
|
|
"changes": {
|
2016-11-02 21:37:30 +03:00
|
|
|
"function-literals.go": [
|
2016-11-01 21:36:23 +03:00
|
|
|
{
|
|
|
|
"span": {
|
|
|
|
"delete": {
|
|
|
|
"start": [
|
2016-11-11 00:19:53 +03:00
|
|
|
1,
|
2016-11-01 21:36:23 +03:00
|
|
|
1
|
|
|
|
],
|
|
|
|
"end": [
|
2016-12-02 00:03:52 +03:00
|
|
|
6,
|
|
|
|
1
|
2016-11-01 21:36:23 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2016-12-02 00:03:52 +03:00
|
|
|
"summary": "Deleted the 'main' module"
|
2016-11-01 21:36:23 +03:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"errors": {}
|
|
|
|
},
|
|
|
|
"filePaths": [
|
2016-11-02 21:37:30 +03:00
|
|
|
"function-literals.go"
|
2016-11-01 21:36:23 +03:00
|
|
|
],
|
2016-11-11 00:19:53 +03:00
|
|
|
"patch": [
|
|
|
|
"diff --git a/function-literals.go b/function-literals.go",
|
2016-12-02 00:03:52 +03:00
|
|
|
"index 7905807..e69de29 100644",
|
2016-11-11 00:19:53 +03:00
|
|
|
"--- a/function-literals.go",
|
|
|
|
"+++ b/function-literals.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-01 21:36:23 +03:00
|
|
|
"gitDir": "test/corpus/repos/go",
|
2017-01-10 23:09:09 +03:00
|
|
|
"shas": "b60e9e4bbc4eadc5871f18f472304a4f1abfbf32..b4de8673b198ab5744eaaf91bcff29a2c9f2267c"
|
2016-11-01 21:36:23 +03:00
|
|
|
}]
|