1
1
mirror of https://github.com/github/semantic.git synced 2024-12-23 23:11:50 +03:00
semantic/test/corpus/diff-summaries/go/map-literals.json

492 lines
16 KiB
JSON

[{
"testCaseDescription": "go-map-literals-setup-test",
"expectedResult": {
"changes": {
"map-literals.go": [
{
"span": {
"insert": {
"start": [
1,
1
],
"end": [
1,
13
]
}
},
"summary": "Added the 'main' module"
},
{
"span": {
"insert": {
"start": [
3,
1
],
"end": [
5,
2
]
}
},
"summary": "Added the 'main' function"
}
]
},
"errors": {}
},
"filePaths": [
"map-literals.go"
],
"patch": [
"diff --git a/map-literals.go b/map-literals.go",
"index e69de29b..79058077 100644",
"--- a/map-literals.go",
"+++ b/map-literals.go",
"@@ -0,0 +1,5 @@",
"+package main",
"+",
"+func main() {",
"+",
"+}"
],
"gitDir": "test/corpus/repos/go",
"shas": "b8e41392436d04ec37de7c7358f5c6f016fc7726..9fc95fb47a671ca191c3f9160fa69e82af7dcaaa"
}
,{
"testCaseDescription": "go-map-literals-insert-test",
"expectedResult": {
"changes": {
"map-literals.go": [
{
"span": {
"insert": {
"start": [
4,
7
],
"end": [
7,
2
]
}
},
"summary": "Added the 's' var assignment in the main function"
}
]
},
"errors": {}
},
"filePaths": [
"map-literals.go"
],
"patch": [
"diff --git a/map-literals.go b/map-literals.go",
"index 79058077..bb99b5ba 100644",
"--- a/map-literals.go",
"+++ b/map-literals.go",
"@@ -1,5 +1,8 @@",
" package main",
" ",
" func main() {",
"-",
"+const s = map[string]string{",
"+\"hi\": \"hello\",",
"+\"bye\": \"goodbye\",",
"+}",
" }"
],
"gitDir": "test/corpus/repos/go",
"shas": "9fc95fb47a671ca191c3f9160fa69e82af7dcaaa..473f91f7465f2fc52a9fd4956332a44a981fe4cb"
}
,{
"testCaseDescription": "go-map-literals-replacement-test",
"expectedResult": {
"changes": {
"map-literals.go": [
{
"span": {
"replace": [
{
"start": [
4,
22
],
"end": [
4,
28
]
},
{
"start": [
4,
22
],
"end": [
4,
25
]
}
]
},
"summary": "Replaced the 'string' identifier with the 'int' identifier in the map[string]int composite_literal of the 'main' function"
},
{
"span": {
"insert": {
"start": [
5,
1
],
"end": [
5,
13
]
}
},
"summary": "Added the '\"foo\": \"bar\"' pair in the map[string]int composite_literal of the 'main' function"
},
{
"span": {
"replace": [
{
"start": [
5,
1
],
"end": [
5,
5
]
},
{
"start": [
6,
1
],
"end": [
6,
6
]
}
]
},
"summary": "Replaced the \"hi\" string with the \"baz\" string in the \"baz\": \"hello\" pair of the 'main' function"
},
{
"span": {
"delete": {
"start": [
6,
1
],
"end": [
6,
17
]
}
},
"summary": "Deleted the '\"bye\": \"goodbye\"' pair in the map[string]int composite_literal of the 'main' function"
}
]
},
"errors": {}
},
"filePaths": [
"map-literals.go"
],
"patch": [
"diff --git a/map-literals.go b/map-literals.go",
"index bb99b5ba..a9e0b664 100644",
"--- a/map-literals.go",
"+++ b/map-literals.go",
"@@ -1,8 +1,8 @@",
" package main",
" ",
" func main() {",
"-const s = map[string]string{",
"-\"hi\": \"hello\",",
"-\"bye\": \"goodbye\",",
"+const s = map[string]int{",
"+\"foo\": \"bar\",",
"+\"baz\": \"hello\",",
" }",
" }"
],
"gitDir": "test/corpus/repos/go",
"shas": "473f91f7465f2fc52a9fd4956332a44a981fe4cb..0ae10bfe6756cfc5348f7d735b0e9fd248e5497f"
}
,{
"testCaseDescription": "go-map-literals-delete-replacement-test",
"expectedResult": {
"changes": {
"map-literals.go": [
{
"span": {
"replace": [
{
"start": [
4,
22
],
"end": [
4,
25
]
},
{
"start": [
4,
22
],
"end": [
4,
28
]
}
]
},
"summary": "Replaced the 'int' identifier with the 'string' identifier in the map[string]string composite_literal of the 'main' function"
},
{
"span": {
"replace": [
{
"start": [
5,
1
],
"end": [
5,
6
]
},
{
"start": [
5,
1
],
"end": [
5,
5
]
}
]
},
"summary": "Replaced the \"foo\" string with the \"hi\" string in the \"hi\": \"hello\" pair of the 'main' function"
},
{
"span": {
"replace": [
{
"start": [
5,
8
],
"end": [
5,
13
]
},
{
"start": [
5,
7
],
"end": [
5,
14
]
}
]
},
"summary": "Replaced the \"bar\" string with the \"hello\" string in the \"hi\": \"hello\" pair of the 'main' function"
},
{
"span": {
"replace": [
{
"start": [
6,
1
],
"end": [
6,
6
]
},
{
"start": [
6,
1
],
"end": [
6,
6
]
}
]
},
"summary": "Replaced the \"baz\" string with the \"bye\" string in the \"bye\": \"goodbye\" pair of the 'main' function"
},
{
"span": {
"replace": [
{
"start": [
6,
8
],
"end": [
6,
15
]
},
{
"start": [
6,
8
],
"end": [
6,
17
]
}
]
},
"summary": "Replaced the \"hello\" string with the \"goodbye\" string in the \"bye\": \"goodbye\" pair of the 'main' function"
}
]
},
"errors": {}
},
"filePaths": [
"map-literals.go"
],
"patch": [
"diff --git a/map-literals.go b/map-literals.go",
"index a9e0b664..bb99b5ba 100644",
"--- a/map-literals.go",
"+++ b/map-literals.go",
"@@ -1,8 +1,8 @@",
" package main",
" ",
" func main() {",
"-const s = map[string]int{",
"-\"foo\": \"bar\",",
"-\"baz\": \"hello\",",
"+const s = map[string]string{",
"+\"hi\": \"hello\",",
"+\"bye\": \"goodbye\",",
" }",
" }"
],
"gitDir": "test/corpus/repos/go",
"shas": "0ae10bfe6756cfc5348f7d735b0e9fd248e5497f..dba7db8f0794b59b17c9a97ba84030fda238568d"
}
,{
"testCaseDescription": "go-map-literals-delete-insert-test",
"expectedResult": {
"changes": {
"map-literals.go": [
{
"span": {
"delete": {
"start": [
4,
7
],
"end": [
7,
2
]
}
},
"summary": "Deleted the 's' var assignment in the main function"
}
]
},
"errors": {}
},
"filePaths": [
"map-literals.go"
],
"patch": [
"diff --git a/map-literals.go b/map-literals.go",
"index bb99b5ba..79058077 100644",
"--- a/map-literals.go",
"+++ b/map-literals.go",
"@@ -1,8 +1,5 @@",
" package main",
" ",
" func main() {",
"-const s = map[string]string{",
"-\"hi\": \"hello\",",
"-\"bye\": \"goodbye\",",
"-}",
"+",
" }"
],
"gitDir": "test/corpus/repos/go",
"shas": "dba7db8f0794b59b17c9a97ba84030fda238568d..d758ae59648d8fc240a1c58cc21f32703979e3cb"
}
,{
"testCaseDescription": "go-map-literals-teardown-test",
"expectedResult": {
"changes": {
"map-literals.go": [
{
"span": {
"delete": {
"start": [
1,
1
],
"end": [
1,
13
]
}
},
"summary": "Deleted the 'main' module"
},
{
"span": {
"delete": {
"start": [
3,
1
],
"end": [
5,
2
]
}
},
"summary": "Deleted the 'main' function"
}
]
},
"errors": {}
},
"filePaths": [
"map-literals.go"
],
"patch": [
"diff --git a/map-literals.go b/map-literals.go",
"index 79058077..e69de29b 100644",
"--- a/map-literals.go",
"+++ b/map-literals.go",
"@@ -1,5 +0,0 @@",
"-package main",
"-",
"-func main() {",
"-",
"-}"
],
"gitDir": "test/corpus/repos/go",
"shas": "d758ae59648d8fc240a1c58cc21f32703979e3cb..0c8ae16482a04b19b4a23f3af01e4d9f314b712e"
}]