1
1
mirror of https://github.com/github/semantic.git synced 2024-12-24 15:35:14 +03:00
semantic/test/corpus/diff-summaries/go/map-literals.json
2017-01-27 14:50:27 -05:00

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": "4de2997942b814c82e06fecad317c0315052231e..2757ceba947af913b50854a40a3bbc60d4ab6e58"
}
,{
"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": "2757ceba947af913b50854a40a3bbc60d4ab6e58..806a3a2bb6ebb7d7a939f8d9c924c18e55fc29bd"
}
,{
"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": "806a3a2bb6ebb7d7a939f8d9c924c18e55fc29bd..b40a309a1a5858189837ed17aeacc473c1291618"
}
,{
"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": "b40a309a1a5858189837ed17aeacc473c1291618..0153290610427d58341c455705ffd3c84393d41f"
}
,{
"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": "0153290610427d58341c455705ffd3c84393d41f..c6bc2ec0da1f9933c4b50f9e035264de96a2a201"
}
,{
"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": "c6bc2ec0da1f9933c4b50f9e035264de96a2a201..e0994dd54a2039ebc5baa7cd76b5db9764beb26a"
}]