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

586 lines
18 KiB
JSON

[{
"testCaseDescription": "go-map-literals-insert-test",
"expectedResult": {
"changes": {
"map-literals.go": [
{
"span": {
"insert": {
"start": [
1,
1
],
"end": [
4,
2
]
}
},
"summary": "Added the 's' variable"
}
]
},
"errors": {}
},
"filePaths": [
"map-literals.go"
],
"patch": [
"diff --git a/map-literals.go b/map-literals.go",
"index e69de29..16fb3cf 100644",
"--- a/map-literals.go",
"+++ b/map-literals.go",
"@@ -0,0 +1,4 @@",
"+const s = map[string]string{",
"+\"hi\": \"hello\",",
"+\"bye\": \"goodbye\",",
"+}"
],
"gitDir": "test/corpus/repos/go",
"shas": "e01e7d3be3d8bb12c09159f3984148a6ec47f133..df720632dde4b370d8fa9fe0b3dfc09d9e29ff3d"
}
,{
"testCaseDescription": "go-map-literals-replacement-insert-test",
"expectedResult": {
"changes": {
"map-literals.go": [
{
"span": {
"insert": {
"start": [
1,
1
],
"end": [
4,
2
]
}
},
"summary": "Added the 's' variable"
},
{
"span": {
"insert": {
"start": [
5,
1
],
"end": [
8,
2
]
}
},
"summary": "Added the 's' variable"
}
]
},
"errors": {}
},
"filePaths": [
"map-literals.go"
],
"patch": [
"diff --git a/map-literals.go b/map-literals.go",
"index 16fb3cf..b3c30ca 100644",
"--- a/map-literals.go",
"+++ b/map-literals.go",
"@@ -1,3 +1,11 @@",
"+const s = map[string]int{",
"+\"foo\": \"bar\",",
"+\"baz\": \"hello\",",
"+}",
"+const s = map[string]string{",
"+\"hi\": \"hello\",",
"+\"bye\": \"goodbye\",",
"+}",
" const s = map[string]string{",
" \"hi\": \"hello\",",
" \"bye\": \"goodbye\","
],
"gitDir": "test/corpus/repos/go",
"shas": "df720632dde4b370d8fa9fe0b3dfc09d9e29ff3d..da7c46865408550075a03c2be73bba879550a1ab"
}
,{
"testCaseDescription": "go-map-literals-delete-insert-test",
"expectedResult": {
"changes": {
"map-literals.go": [
{
"span": {
"replace": [
{
"start": [
1,
22
],
"end": [
1,
25
]
},
{
"start": [
1,
15
],
"end": [
1,
21
]
}
]
},
"summary": "Replaced the 'int' identifier with the 'string' identifier in the s variable"
},
{
"span": {
"replace": [
{
"start": [
2,
1
],
"end": [
2,
6
]
},
{
"start": [
2,
1
],
"end": [
2,
5
]
}
]
},
"summary": "Replaced the \"foo\" string with the \"hi\" string in the s variable"
},
{
"span": {
"replace": [
{
"start": [
2,
8
],
"end": [
2,
13
]
},
{
"start": [
2,
7
],
"end": [
2,
14
]
}
]
},
"summary": "Replaced the \"bar\" string with the \"hello\" string in the s variable"
},
{
"span": {
"replace": [
{
"start": [
3,
1
],
"end": [
3,
6
]
},
{
"start": [
3,
1
],
"end": [
3,
6
]
}
]
},
"summary": "Replaced the \"baz\" string with the \"bye\" string in the s variable"
},
{
"span": {
"replace": [
{
"start": [
3,
8
],
"end": [
3,
15
]
},
{
"start": [
3,
8
],
"end": [
3,
17
]
}
]
},
"summary": "Replaced the \"hello\" string with the \"goodbye\" string in the s variable"
}
]
},
"errors": {}
},
"filePaths": [
"map-literals.go"
],
"patch": [
"diff --git a/map-literals.go b/map-literals.go",
"index b3c30ca..72c2e91 100644",
"--- a/map-literals.go",
"+++ b/map-literals.go",
"@@ -1,6 +1,6 @@",
"-const s = map[string]int{",
"-\"foo\": \"bar\",",
"-\"baz\": \"hello\",",
"+const s = map[string]string{",
"+\"hi\": \"hello\",",
"+\"bye\": \"goodbye\",",
" }",
" const s = map[string]string{",
" \"hi\": \"hello\","
],
"gitDir": "test/corpus/repos/go",
"shas": "da7c46865408550075a03c2be73bba879550a1ab..e013a76261fd7e33ff8b60ce9896bb766dc3921a"
}
,{
"testCaseDescription": "go-map-literals-replacement-test",
"expectedResult": {
"changes": {
"map-literals.go": [
{
"span": {
"delete": {
"start": [
1,
15
],
"end": [
1,
21
]
}
},
"summary": "Deleted the 'string' identifier in the s variable"
},
{
"span": {
"insert": {
"start": [
1,
22
],
"end": [
1,
25
]
}
},
"summary": "Added the 'int' identifier in the s variable"
},
{
"span": {
"insert": {
"start": [
2,
1
],
"end": [
2,
6
]
}
},
"summary": "Added the \"foo\" string in the s variable"
},
{
"span": {
"insert": {
"start": [
2,
8
],
"end": [
2,
13
]
}
},
"summary": "Added the \"bar\" string in the s variable"
},
{
"span": {
"replace": [
{
"start": [
2,
1
],
"end": [
2,
5
]
},
{
"start": [
3,
1
],
"end": [
3,
6
]
}
]
},
"summary": "Replaced the \"hi\" string with the \"baz\" string in the s variable"
},
{
"span": {
"delete": {
"start": [
3,
1
],
"end": [
3,
6
]
}
},
"summary": "Deleted the \"bye\" string in the s variable"
},
{
"span": {
"delete": {
"start": [
3,
8
],
"end": [
3,
17
]
}
},
"summary": "Deleted the \"goodbye\" string in the s variable"
}
]
},
"errors": {}
},
"filePaths": [
"map-literals.go"
],
"patch": [
"diff --git a/map-literals.go b/map-literals.go",
"index 72c2e91..b3c30ca 100644",
"--- a/map-literals.go",
"+++ b/map-literals.go",
"@@ -1,6 +1,6 @@",
"-const s = map[string]string{",
"-\"hi\": \"hello\",",
"-\"bye\": \"goodbye\",",
"+const s = map[string]int{",
"+\"foo\": \"bar\",",
"+\"baz\": \"hello\",",
" }",
" const s = map[string]string{",
" \"hi\": \"hello\","
],
"gitDir": "test/corpus/repos/go",
"shas": "e013a76261fd7e33ff8b60ce9896bb766dc3921a..69e8e5ba308ef010ba6dc41d652ac0c9cc480309"
}
,{
"testCaseDescription": "go-map-literals-delete-replacement-test",
"expectedResult": {
"changes": {
"map-literals.go": [
{
"span": {
"delete": {
"start": [
1,
1
],
"end": [
4,
2
]
}
},
"summary": "Deleted the 's' variable"
},
{
"span": {
"delete": {
"start": [
5,
1
],
"end": [
8,
2
]
}
},
"summary": "Deleted the 's' variable"
},
{
"span": {
"insert": {
"start": [
5,
1
],
"end": [
8,
2
]
}
},
"summary": "Added the 's' variable"
}
]
},
"errors": {}
},
"filePaths": [
"map-literals.go"
],
"patch": [
"diff --git a/map-literals.go b/map-literals.go",
"index b3c30ca..6d5f577 100644",
"--- a/map-literals.go",
"+++ b/map-literals.go",
"@@ -1,12 +1,8 @@",
"-const s = map[string]int{",
"-\"foo\": \"bar\",",
"-\"baz\": \"hello\",",
"-}",
" const s = map[string]string{",
" \"hi\": \"hello\",",
" \"bye\": \"goodbye\",",
" }",
"-const s = map[string]string{",
"-\"hi\": \"hello\",",
"-\"bye\": \"goodbye\",",
"+const s = map[string]int{",
"+\"foo\": \"bar\",",
"+\"baz\": \"hello\",",
" }"
],
"gitDir": "test/corpus/repos/go",
"shas": "69e8e5ba308ef010ba6dc41d652ac0c9cc480309..eec9e96ffba6cfd4d932682e433addbc19cae465"
}
,{
"testCaseDescription": "go-map-literals-delete-test",
"expectedResult": {
"changes": {
"map-literals.go": [
{
"span": {
"delete": {
"start": [
1,
1
],
"end": [
4,
2
]
}
},
"summary": "Deleted the 's' variable"
}
]
},
"errors": {}
},
"filePaths": [
"map-literals.go"
],
"patch": [
"diff --git a/map-literals.go b/map-literals.go",
"index 6d5f577..7f8e649 100644",
"--- a/map-literals.go",
"+++ b/map-literals.go",
"@@ -1,7 +1,3 @@",
"-const s = map[string]string{",
"-\"hi\": \"hello\",",
"-\"bye\": \"goodbye\",",
"-}",
" const s = map[string]int{",
" \"foo\": \"bar\",",
" \"baz\": \"hello\","
],
"gitDir": "test/corpus/repos/go",
"shas": "eec9e96ffba6cfd4d932682e433addbc19cae465..36df85797f88315cdec3c509c8edc13aabe5cae0"
}
,{
"testCaseDescription": "go-map-literals-delete-rest-test",
"expectedResult": {
"changes": {
"map-literals.go": [
{
"span": {
"delete": {
"start": [
1,
1
],
"end": [
4,
2
]
}
},
"summary": "Deleted the 's' variable"
}
]
},
"errors": {}
},
"filePaths": [
"map-literals.go"
],
"patch": [
"diff --git a/map-literals.go b/map-literals.go",
"index 7f8e649..e69de29 100644",
"--- a/map-literals.go",
"+++ b/map-literals.go",
"@@ -1,4 +0,0 @@",
"-const s = map[string]int{",
"-\"foo\": \"bar\",",
"-\"baz\": \"hello\",",
"-}"
],
"gitDir": "test/corpus/repos/go",
"shas": "36df85797f88315cdec3c509c8edc13aabe5cae0..9d2f3b70209e80ce80db6ab7a29c5d3304b4bde4"
}]