1
1
mirror of https://github.com/github/semantic.git synced 2024-12-24 23:42:31 +03:00
semantic/test/corpus/diff-summaries/go/map-literals.json
2017-01-11 15:28:58 -08:00

492 lines
16 KiB
JSON

[{
"testCaseDescription": "go-map-literals-setup-test",
"expectedResult": {
"changes": {
"map-literals.go": [
{
"span": {
"insert": {
"start": [
1,
1
],
"end": [
6,
1
]
}
},
"summary": "Added the 'main' module"
}
]
},
"errors": {}
},
"filePaths": [
"map-literals.go"
],
"patch": [
"diff --git a/map-literals.go b/map-literals.go",
"index e69de29..7905807 100644",
"--- a/map-literals.go",
"+++ b/map-literals.go",
"@@ -0,0 +1,5 @@",
"+package main",
"+",
"+func main() {",
"+",
"+}"
],
"gitDir": "test/corpus/repos/go",
"shas": "261a5e2932b5820448fae2f0a1afcef36285490f..8f479284b0d20c14b3746304b6ddab99bcfa7761"
}
,{
"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 of the 'main' module"
}
]
},
"errors": {}
},
"filePaths": [
"map-literals.go"
],
"patch": [
"diff --git a/map-literals.go b/map-literals.go",
"index 7905807..bb99b5b 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": "8f479284b0d20c14b3746304b6ddab99bcfa7761..1eb7e10b4b043627b32963b426c76113849ccda2"
}
,{
"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 dictionary of the 'main' function"
},
{
"span": {
"insert": {
"start": [
5,
1
],
"end": [
5,
6
]
}
},
"summary": "Added the \"foo\" string in the map[string]int dictionary of the 'main' function"
},
{
"span": {
"insert": {
"start": [
5,
8
],
"end": [
5,
13
]
}
},
"summary": "Added the \"bar\" string in the map[string]int dictionary 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 map[string]int dictionary of the 'main' function"
},
{
"span": {
"delete": {
"start": [
6,
1
],
"end": [
6,
6
]
}
},
"summary": "Deleted the \"bye\" string in the map[string]int dictionary of the 'main' function"
},
{
"span": {
"delete": {
"start": [
6,
8
],
"end": [
6,
17
]
}
},
"summary": "Deleted the \"goodbye\" string in the map[string]int dictionary of the 'main' function"
}
]
},
"errors": {}
},
"filePaths": [
"map-literals.go"
],
"patch": [
"diff --git a/map-literals.go b/map-literals.go",
"index bb99b5b..a9e0b66 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": "1eb7e10b4b043627b32963b426c76113849ccda2..680a4bf433a347bf9a3df3e50411b529bd4e52ac"
}
,{
"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 dictionary 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 map[string]string dictionary 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 map[string]string dictionary 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 map[string]string dictionary 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 map[string]string dictionary of the 'main' function"
}
]
},
"errors": {}
},
"filePaths": [
"map-literals.go"
],
"patch": [
"diff --git a/map-literals.go b/map-literals.go",
"index a9e0b66..bb99b5b 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": "680a4bf433a347bf9a3df3e50411b529bd4e52ac..cdfebf813f586881387f488b433420e893707459"
}
,{
"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 of the 'main' module"
}
]
},
"errors": {}
},
"filePaths": [
"map-literals.go"
],
"patch": [
"diff --git a/map-literals.go b/map-literals.go",
"index bb99b5b..7905807 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": "cdfebf813f586881387f488b433420e893707459..252f78cf6d6a490428362bf74ed220115990427c"
}
,{
"testCaseDescription": "go-map-literals-teardown-test",
"expectedResult": {
"changes": {
"map-literals.go": [
{
"span": {
"delete": {
"start": [
1,
1
],
"end": [
6,
1
]
}
},
"summary": "Deleted the 'main' module"
}
]
},
"errors": {}
},
"filePaths": [
"map-literals.go"
],
"patch": [
"diff --git a/map-literals.go b/map-literals.go",
"index 7905807..e69de29 100644",
"--- a/map-literals.go",
"+++ b/map-literals.go",
"@@ -1,5 +0,0 @@",
"-package main",
"-",
"-func main() {",
"-",
"-}"
],
"gitDir": "test/corpus/repos/go",
"shas": "252f78cf6d6a490428362bf74ed220115990427c..55db2fe06bab1194ac40bdfd7dc8bca5d8f62fed"
}]