2016-11-02 04:36:43 +03:00
|
|
|
[{
|
2016-12-02 00:03:52 +03:00
|
|
|
"testCaseDescription": "go-map-literals-setup-test",
|
2016-11-02 04:36:43 +03:00
|
|
|
"expectedResult": {
|
|
|
|
"changes": {
|
2016-11-02 21:37:30 +03:00
|
|
|
"map-literals.go": [
|
2016-11-02 04:36:43 +03:00
|
|
|
{
|
|
|
|
"span": {
|
|
|
|
"insert": {
|
|
|
|
"start": [
|
2016-11-11 00:19:53 +03:00
|
|
|
1,
|
2016-11-02 04:36:43 +03:00
|
|
|
1
|
|
|
|
],
|
|
|
|
"end": [
|
2017-01-24 23:09:28 +03:00
|
|
|
1,
|
|
|
|
13
|
2016-11-02 04:36:43 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2016-12-02 00:03:52 +03:00
|
|
|
"summary": "Added the 'main' module"
|
2017-01-24 23:09:28 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"span": {
|
|
|
|
"insert": {
|
|
|
|
"start": [
|
|
|
|
3,
|
|
|
|
1
|
|
|
|
],
|
|
|
|
"end": [
|
|
|
|
5,
|
|
|
|
2
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"summary": "Added the 'main' function"
|
2016-11-02 04:36:43 +03:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2016-11-02 21:37:30 +03:00
|
|
|
"errors": {}
|
2016-11-02 04:36:43 +03:00
|
|
|
},
|
|
|
|
"filePaths": [
|
2016-11-02 21:37:30 +03:00
|
|
|
"map-literals.go"
|
2016-11-02 04:36:43 +03:00
|
|
|
],
|
2016-11-11 00:19:53 +03:00
|
|
|
"patch": [
|
|
|
|
"diff --git a/map-literals.go b/map-literals.go",
|
2017-01-17 23:26:07 +03:00
|
|
|
"index e69de29b..79058077 100644",
|
2016-11-11 00:19:53 +03:00
|
|
|
"--- a/map-literals.go",
|
|
|
|
"+++ b/map-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-02 04:36:43 +03:00
|
|
|
"gitDir": "test/corpus/repos/go",
|
2017-02-07 18:51:15 +03:00
|
|
|
"shas": "7d45b7b9d0cd21bc6e8f950464bb9ad4e1230ed9..aeb65aaeb42ef307d45dc401bf4b5738a16eebfb"
|
2016-11-02 04:36:43 +03:00
|
|
|
}
|
|
|
|
,{
|
2016-12-02 00:03:52 +03:00
|
|
|
"testCaseDescription": "go-map-literals-insert-test",
|
2016-11-02 04:36:43 +03:00
|
|
|
"expectedResult": {
|
2016-12-07 23:41:28 +03:00
|
|
|
"changes": {
|
|
|
|
"map-literals.go": [
|
|
|
|
{
|
|
|
|
"span": {
|
|
|
|
"insert": {
|
|
|
|
"start": [
|
|
|
|
4,
|
2017-01-10 23:09:09 +03:00
|
|
|
7
|
2016-12-07 23:41:28 +03:00
|
|
|
],
|
|
|
|
"end": [
|
|
|
|
7,
|
|
|
|
2
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2017-01-24 23:09:28 +03:00
|
|
|
"summary": "Added the 's' var assignment in the main function"
|
2016-12-07 23:41:28 +03:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2016-11-02 21:37:30 +03:00
|
|
|
"errors": {}
|
2016-11-02 04:36:43 +03:00
|
|
|
},
|
|
|
|
"filePaths": [
|
2016-11-02 21:37:30 +03:00
|
|
|
"map-literals.go"
|
2016-11-02 04:36:43 +03:00
|
|
|
],
|
2016-11-11 00:19:53 +03:00
|
|
|
"patch": [
|
|
|
|
"diff --git a/map-literals.go b/map-literals.go",
|
2017-01-17 23:26:07 +03:00
|
|
|
"index 79058077..bb99b5ba 100644",
|
2016-11-11 00:19:53 +03:00
|
|
|
"--- a/map-literals.go",
|
|
|
|
"+++ b/map-literals.go",
|
2016-12-02 00:03:52 +03:00
|
|
|
"@@ -1,5 +1,8 @@",
|
|
|
|
" package main",
|
|
|
|
" ",
|
|
|
|
" func main() {",
|
|
|
|
"-",
|
2016-11-11 00:19:53 +03:00
|
|
|
"+const s = map[string]string{",
|
|
|
|
"+\"hi\": \"hello\",",
|
|
|
|
"+\"bye\": \"goodbye\",",
|
|
|
|
"+}",
|
2016-12-02 00:03:52 +03:00
|
|
|
" }"
|
2016-11-11 00:19:53 +03:00
|
|
|
],
|
2016-11-02 04:36:43 +03:00
|
|
|
"gitDir": "test/corpus/repos/go",
|
2017-02-07 18:51:15 +03:00
|
|
|
"shas": "aeb65aaeb42ef307d45dc401bf4b5738a16eebfb..b94d9a451e86fca1469ce881b26582fc41915f9a"
|
2016-11-02 04:36:43 +03:00
|
|
|
}
|
|
|
|
,{
|
2016-11-02 21:37:30 +03:00
|
|
|
"testCaseDescription": "go-map-literals-replacement-test",
|
2016-11-02 04:36:43 +03:00
|
|
|
"expectedResult": {
|
2016-12-07 23:41:28 +03:00
|
|
|
"changes": {
|
|
|
|
"map-literals.go": [
|
|
|
|
{
|
|
|
|
"span": {
|
2017-01-10 01:21:36 +03:00
|
|
|
"replace": [
|
|
|
|
{
|
|
|
|
"start": [
|
|
|
|
4,
|
|
|
|
22
|
|
|
|
],
|
|
|
|
"end": [
|
|
|
|
4,
|
|
|
|
28
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"start": [
|
|
|
|
4,
|
|
|
|
22
|
|
|
|
],
|
|
|
|
"end": [
|
|
|
|
4,
|
|
|
|
25
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2017-01-24 23:09:28 +03:00
|
|
|
"summary": "Replaced the 'string' identifier with the 'int' identifier in the map[string]int composite_literal of the 'main' function"
|
2017-01-10 01:21:36 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"span": {
|
|
|
|
"insert": {
|
2016-12-07 23:41:28 +03:00
|
|
|
"start": [
|
2017-01-10 01:21:36 +03:00
|
|
|
5,
|
|
|
|
1
|
2016-12-07 23:41:28 +03:00
|
|
|
],
|
|
|
|
"end": [
|
2017-01-10 01:21:36 +03:00
|
|
|
5,
|
|
|
|
13
|
2016-12-07 23:41:28 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2017-01-24 23:09:28 +03:00
|
|
|
"summary": "Added the '\"foo\": \"bar\"' pair in the map[string]int composite_literal of the 'main' function"
|
2016-12-07 23:41:28 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"span": {
|
|
|
|
"replace": [
|
|
|
|
{
|
|
|
|
"start": [
|
|
|
|
5,
|
|
|
|
1
|
|
|
|
],
|
|
|
|
"end": [
|
|
|
|
5,
|
|
|
|
5
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"start": [
|
2017-01-10 01:21:36 +03:00
|
|
|
6,
|
2016-12-07 23:41:28 +03:00
|
|
|
1
|
|
|
|
],
|
|
|
|
"end": [
|
2017-01-10 01:21:36 +03:00
|
|
|
6,
|
2016-12-07 23:41:28 +03:00
|
|
|
6
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2017-01-18 21:23:54 +03:00
|
|
|
"summary": "Replaced the \"hi\" string with the \"baz\" string in the \"baz\": \"hello\" pair of the 'main' function"
|
2016-12-07 23:41:28 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"span": {
|
2017-01-10 01:21:36 +03:00
|
|
|
"delete": {
|
|
|
|
"start": [
|
|
|
|
6,
|
|
|
|
1
|
|
|
|
],
|
|
|
|
"end": [
|
|
|
|
6,
|
|
|
|
17
|
|
|
|
]
|
|
|
|
}
|
2016-12-07 23:41:28 +03:00
|
|
|
},
|
2017-01-24 23:09:28 +03:00
|
|
|
"summary": "Deleted the '\"bye\": \"goodbye\"' pair in the map[string]int composite_literal of the 'main' function"
|
2016-12-07 23:41:28 +03:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2016-11-02 21:37:30 +03:00
|
|
|
"errors": {}
|
2016-11-02 04:36:43 +03:00
|
|
|
},
|
|
|
|
"filePaths": [
|
2016-11-02 21:37:30 +03:00
|
|
|
"map-literals.go"
|
2016-11-02 04:36:43 +03:00
|
|
|
],
|
2016-11-11 00:19:53 +03:00
|
|
|
"patch": [
|
|
|
|
"diff --git a/map-literals.go b/map-literals.go",
|
2017-01-17 23:26:07 +03:00
|
|
|
"index bb99b5ba..a9e0b664 100644",
|
2016-11-11 00:19:53 +03:00
|
|
|
"--- a/map-literals.go",
|
|
|
|
"+++ b/map-literals.go",
|
2016-12-02 00:03:52 +03:00
|
|
|
"@@ -1,8 +1,8 @@",
|
|
|
|
" package main",
|
|
|
|
" ",
|
|
|
|
" func main() {",
|
2016-11-11 00:19:53 +03:00
|
|
|
"-const s = map[string]string{",
|
|
|
|
"-\"hi\": \"hello\",",
|
|
|
|
"-\"bye\": \"goodbye\",",
|
|
|
|
"+const s = map[string]int{",
|
|
|
|
"+\"foo\": \"bar\",",
|
|
|
|
"+\"baz\": \"hello\",",
|
|
|
|
" }",
|
2016-12-02 00:03:52 +03:00
|
|
|
" }"
|
2016-11-11 00:19:53 +03:00
|
|
|
],
|
2016-11-02 04:36:43 +03:00
|
|
|
"gitDir": "test/corpus/repos/go",
|
2017-02-07 18:51:15 +03:00
|
|
|
"shas": "b94d9a451e86fca1469ce881b26582fc41915f9a..f6ea0d0bccc307a7878e179cd7546cbc68db017b"
|
2016-11-02 04:36:43 +03:00
|
|
|
}
|
|
|
|
,{
|
2016-11-02 21:37:30 +03:00
|
|
|
"testCaseDescription": "go-map-literals-delete-replacement-test",
|
2016-11-02 04:36:43 +03:00
|
|
|
"expectedResult": {
|
2016-12-07 23:41:28 +03:00
|
|
|
"changes": {
|
|
|
|
"map-literals.go": [
|
|
|
|
{
|
|
|
|
"span": {
|
|
|
|
"replace": [
|
|
|
|
{
|
|
|
|
"start": [
|
|
|
|
4,
|
|
|
|
22
|
|
|
|
],
|
|
|
|
"end": [
|
|
|
|
4,
|
|
|
|
25
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"start": [
|
|
|
|
4,
|
2017-01-10 01:21:36 +03:00
|
|
|
22
|
2016-12-07 23:41:28 +03:00
|
|
|
],
|
|
|
|
"end": [
|
|
|
|
4,
|
2017-01-10 01:21:36 +03:00
|
|
|
28
|
2016-12-07 23:41:28 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2017-01-24 23:09:28 +03:00
|
|
|
"summary": "Replaced the 'int' identifier with the 'string' identifier in the map[string]string composite_literal of the 'main' function"
|
2016-12-07 23:41:28 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"span": {
|
|
|
|
"replace": [
|
|
|
|
{
|
|
|
|
"start": [
|
|
|
|
5,
|
|
|
|
1
|
|
|
|
],
|
|
|
|
"end": [
|
|
|
|
5,
|
|
|
|
6
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"start": [
|
|
|
|
5,
|
|
|
|
1
|
|
|
|
],
|
|
|
|
"end": [
|
|
|
|
5,
|
|
|
|
5
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2017-01-18 21:23:54 +03:00
|
|
|
"summary": "Replaced the \"foo\" string with the \"hi\" string in the \"hi\": \"hello\" pair of the 'main' function"
|
2016-12-07 23:41:28 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"span": {
|
|
|
|
"replace": [
|
|
|
|
{
|
|
|
|
"start": [
|
|
|
|
5,
|
|
|
|
8
|
|
|
|
],
|
|
|
|
"end": [
|
|
|
|
5,
|
|
|
|
13
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"start": [
|
|
|
|
5,
|
|
|
|
7
|
|
|
|
],
|
|
|
|
"end": [
|
|
|
|
5,
|
|
|
|
14
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2017-01-18 21:23:54 +03:00
|
|
|
"summary": "Replaced the \"bar\" string with the \"hello\" string in the \"hi\": \"hello\" pair of the 'main' function"
|
2016-12-07 23:41:28 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"span": {
|
|
|
|
"replace": [
|
|
|
|
{
|
|
|
|
"start": [
|
|
|
|
6,
|
|
|
|
1
|
|
|
|
],
|
|
|
|
"end": [
|
|
|
|
6,
|
|
|
|
6
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"start": [
|
|
|
|
6,
|
|
|
|
1
|
|
|
|
],
|
|
|
|
"end": [
|
|
|
|
6,
|
|
|
|
6
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2017-01-18 21:23:54 +03:00
|
|
|
"summary": "Replaced the \"baz\" string with the \"bye\" string in the \"bye\": \"goodbye\" pair of the 'main' function"
|
2016-12-07 23:41:28 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"span": {
|
|
|
|
"replace": [
|
|
|
|
{
|
|
|
|
"start": [
|
|
|
|
6,
|
|
|
|
8
|
|
|
|
],
|
|
|
|
"end": [
|
|
|
|
6,
|
|
|
|
15
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"start": [
|
|
|
|
6,
|
|
|
|
8
|
|
|
|
],
|
|
|
|
"end": [
|
|
|
|
6,
|
|
|
|
17
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2017-01-18 21:23:54 +03:00
|
|
|
"summary": "Replaced the \"hello\" string with the \"goodbye\" string in the \"bye\": \"goodbye\" pair of the 'main' function"
|
2016-12-07 23:41:28 +03:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2016-11-02 21:37:30 +03:00
|
|
|
"errors": {}
|
2016-11-02 04:36:43 +03:00
|
|
|
},
|
|
|
|
"filePaths": [
|
2016-11-02 21:37:30 +03:00
|
|
|
"map-literals.go"
|
2016-11-02 04:36:43 +03:00
|
|
|
],
|
2016-11-11 00:19:53 +03:00
|
|
|
"patch": [
|
|
|
|
"diff --git a/map-literals.go b/map-literals.go",
|
2017-01-17 23:26:07 +03:00
|
|
|
"index a9e0b664..bb99b5ba 100644",
|
2016-11-11 00:19:53 +03:00
|
|
|
"--- a/map-literals.go",
|
|
|
|
"+++ b/map-literals.go",
|
2016-12-02 00:03:52 +03:00
|
|
|
"@@ -1,8 +1,8 @@",
|
|
|
|
" package main",
|
|
|
|
" ",
|
|
|
|
" func main() {",
|
2016-11-11 00:19:53 +03:00
|
|
|
"-const s = map[string]int{",
|
|
|
|
"-\"foo\": \"bar\",",
|
|
|
|
"-\"baz\": \"hello\",",
|
2016-12-02 00:03:52 +03:00
|
|
|
"+const s = map[string]string{",
|
|
|
|
"+\"hi\": \"hello\",",
|
|
|
|
"+\"bye\": \"goodbye\",",
|
2016-11-11 00:19:53 +03:00
|
|
|
" }",
|
|
|
|
" }"
|
|
|
|
],
|
2016-11-02 04:36:43 +03:00
|
|
|
"gitDir": "test/corpus/repos/go",
|
2017-02-07 18:51:15 +03:00
|
|
|
"shas": "f6ea0d0bccc307a7878e179cd7546cbc68db017b..4c873fd8153b765bd75faac471b7d65e2b32729a"
|
2016-11-02 04:36:43 +03:00
|
|
|
}
|
|
|
|
,{
|
2016-12-02 00:03:52 +03:00
|
|
|
"testCaseDescription": "go-map-literals-delete-insert-test",
|
2016-11-02 04:36:43 +03:00
|
|
|
"expectedResult": {
|
2016-12-07 23:41:28 +03:00
|
|
|
"changes": {
|
|
|
|
"map-literals.go": [
|
|
|
|
{
|
|
|
|
"span": {
|
|
|
|
"delete": {
|
|
|
|
"start": [
|
|
|
|
4,
|
2017-01-10 23:09:09 +03:00
|
|
|
7
|
2016-12-07 23:41:28 +03:00
|
|
|
],
|
|
|
|
"end": [
|
|
|
|
7,
|
|
|
|
2
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2017-01-24 23:09:28 +03:00
|
|
|
"summary": "Deleted the 's' var assignment in the main function"
|
2016-12-07 23:41:28 +03:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2016-11-02 21:37:30 +03:00
|
|
|
"errors": {}
|
|
|
|
},
|
|
|
|
"filePaths": [
|
|
|
|
"map-literals.go"
|
|
|
|
],
|
2016-11-11 00:19:53 +03:00
|
|
|
"patch": [
|
|
|
|
"diff --git a/map-literals.go b/map-literals.go",
|
2017-01-17 23:26:07 +03:00
|
|
|
"index bb99b5ba..79058077 100644",
|
2016-11-11 00:19:53 +03:00
|
|
|
"--- a/map-literals.go",
|
|
|
|
"+++ b/map-literals.go",
|
2016-12-02 00:03:52 +03:00
|
|
|
"@@ -1,8 +1,5 @@",
|
|
|
|
" package main",
|
|
|
|
" ",
|
|
|
|
" func main() {",
|
2016-11-11 00:19:53 +03:00
|
|
|
"-const s = map[string]string{",
|
|
|
|
"-\"hi\": \"hello\",",
|
|
|
|
"-\"bye\": \"goodbye\",",
|
|
|
|
"-}",
|
2016-12-02 00:03:52 +03:00
|
|
|
"+",
|
|
|
|
" }"
|
2016-11-11 00:19:53 +03:00
|
|
|
],
|
2016-11-02 21:37:30 +03:00
|
|
|
"gitDir": "test/corpus/repos/go",
|
2017-02-07 18:51:15 +03:00
|
|
|
"shas": "4c873fd8153b765bd75faac471b7d65e2b32729a..3a38582f722148eb574ef089d38273eef0f47ff8"
|
2016-11-02 21:37:30 +03:00
|
|
|
}
|
|
|
|
,{
|
2016-12-02 00:03:52 +03:00
|
|
|
"testCaseDescription": "go-map-literals-teardown-test",
|
2016-11-02 21:37:30 +03:00
|
|
|
"expectedResult": {
|
|
|
|
"changes": {
|
|
|
|
"map-literals.go": [
|
2016-11-02 04:36:43 +03:00
|
|
|
{
|
|
|
|
"span": {
|
|
|
|
"delete": {
|
|
|
|
"start": [
|
2016-11-11 00:19:53 +03:00
|
|
|
1,
|
2016-11-02 04:36:43 +03:00
|
|
|
1
|
|
|
|
],
|
|
|
|
"end": [
|
2017-01-24 23:09:28 +03:00
|
|
|
1,
|
|
|
|
13
|
2016-11-02 04:36:43 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2016-12-02 00:03:52 +03:00
|
|
|
"summary": "Deleted the 'main' module"
|
2017-01-24 23:09:28 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"span": {
|
|
|
|
"delete": {
|
|
|
|
"start": [
|
|
|
|
3,
|
|
|
|
1
|
|
|
|
],
|
|
|
|
"end": [
|
|
|
|
5,
|
|
|
|
2
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"summary": "Deleted the 'main' function"
|
2016-11-02 04:36:43 +03:00
|
|
|
}
|
|
|
|
]
|
2016-11-02 21:37:30 +03:00
|
|
|
},
|
|
|
|
"errors": {}
|
2016-11-02 04:36:43 +03:00
|
|
|
},
|
|
|
|
"filePaths": [
|
2016-11-02 21:37:30 +03:00
|
|
|
"map-literals.go"
|
2016-11-02 04:36:43 +03:00
|
|
|
],
|
2016-11-11 00:19:53 +03:00
|
|
|
"patch": [
|
|
|
|
"diff --git a/map-literals.go b/map-literals.go",
|
2017-01-17 23:26:07 +03:00
|
|
|
"index 79058077..e69de29b 100644",
|
2016-11-11 00:19:53 +03:00
|
|
|
"--- a/map-literals.go",
|
|
|
|
"+++ b/map-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-02 04:36:43 +03:00
|
|
|
"gitDir": "test/corpus/repos/go",
|
2017-02-07 18:51:15 +03:00
|
|
|
"shas": "3a38582f722148eb574ef089d38273eef0f47ff8..7daeec28ef0d87b8689a78b17f7326b34bdb0a5a"
|
2016-11-02 04:36:43 +03:00
|
|
|
}]
|