1
1
mirror of https://github.com/github/semantic.git synced 2024-12-23 14:54:16 +03:00
semantic/test/corpus/diff-summaries/go/map-literals.json
2017-01-18 13:23:54 -05:00

462 lines
15 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 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": "e838e9902cf224a0dee7607076c1acae9d08d510..20750702aa0a2224e99a5afb9c0908548bc66ff2"
}
,{
"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 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": "20750702aa0a2224e99a5afb9c0908548bc66ff2..a2a3886dcf5aa06f79b9432cc186c0b975d4d829"
}
,{
"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,
13
]
}
},
"summary": "Added the '\"foo\": \"bar\"' pair 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 \"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 dictionary 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": "a2a3886dcf5aa06f79b9432cc186c0b975d4d829..00acd5542e53b24433e5b677bac99fbda7ca5d50"
}
,{
"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 \"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": "00acd5542e53b24433e5b677bac99fbda7ca5d50..26ffb42a1f92eed063d05463056a02d5c56affe0"
}
,{
"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 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": "26ffb42a1f92eed063d05463056a02d5c56affe0..8f83b4b589dccf7498edc42259707c88e07faf68"
}
,{
"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 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": "8f83b4b589dccf7498edc42259707c88e07faf68..42798e094a7b54602c02e57ed28f95c0e36804d9"
}]