1
1
mirror of https://github.com/github/semantic.git synced 2024-12-23 06:41:45 +03:00
semantic/test/corpus/diff-summaries/go/struct-literals.json
2017-02-07 11:37:47 -05:00

611 lines
20 KiB
JSON

[{
"testCaseDescription": "go-struct-literals-setup-test",
"expectedResult": {
"changes": {
"struct-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": [
"struct-literals.go"
],
"patch": [
"diff --git a/struct-literals.go b/struct-literals.go",
"index e69de29b..79058077 100644",
"--- a/struct-literals.go",
"+++ b/struct-literals.go",
"@@ -0,0 +1,5 @@",
"+package main",
"+",
"+func main() {",
"+",
"+}"
],
"gitDir": "test/corpus/repos/go",
"shas": "6c6fe03e1ce4f7369c5cd528025e7e80a78cb2e3..98ca68a371b88e4f49719feef7f05c0ace8294d1"
}
,{
"testCaseDescription": "go-struct-literals-insert-test",
"expectedResult": {
"changes": {
"struct-literals.go": [
{
"span": {
"insert": {
"start": [
4,
7
],
"end": [
7,
2
]
}
},
"summary": "Added the 's1' var assignment in the main function"
},
{
"span": {
"insert": {
"start": [
8,
7
],
"end": [
8,
32
]
}
},
"summary": "Added the 's2' var assignment in the main function"
},
{
"span": {
"insert": {
"start": [
9,
7
],
"end": [
9,
23
]
}
},
"summary": "Added the 's3' var assignment in the main function"
}
]
},
"errors": {}
},
"filePaths": [
"struct-literals.go"
],
"patch": [
"diff --git a/struct-literals.go b/struct-literals.go",
"index 79058077..e6fd4f15 100644",
"--- a/struct-literals.go",
"+++ b/struct-literals.go",
"@@ -1,5 +1,10 @@",
" package main",
" ",
" func main() {",
"-",
"+const s1 = Person{",
"+name: \"Frank\",",
"+Age: \"5 months\",",
"+}",
"+const s2 = struct{i int;}{i: 5}",
"+const s3 = time.Time{}",
" }"
],
"gitDir": "test/corpus/repos/go",
"shas": "98ca68a371b88e4f49719feef7f05c0ace8294d1..16546622d6d5c3abb229f1efd401797b70d45e78"
}
,{
"testCaseDescription": "go-struct-literals-replacement-test",
"expectedResult": {
"changes": {
"struct-literals.go": [
{
"span": {
"replace": [
{
"start": [
4,
12
],
"end": [
4,
18
]
},
{
"start": [
4,
12
],
"end": [
4,
15
]
}
]
},
"summary": "Replaced the 'Person' identifier with the 'Dog' identifier in the s1 var assignment of the 'main' function"
},
{
"span": {
"replace": [
{
"start": [
8,
21
],
"end": [
8,
24
]
},
{
"start": [
8,
21
],
"end": [
8,
26
]
}
]
},
"summary": "Replaced the 'int' identifier with the 'float' identifier in the struct{i float;} struct type of the 'main' function"
},
{
"span": {
"replace": [
{
"start": [
8,
27
],
"end": [
8,
28
]
},
{
"start": [
8,
29
],
"end": [
8,
30
]
}
]
},
"summary": "Replaced the 'i' identifier with the 'j' identifier in the j: 6 pair of the 'main' function"
},
{
"span": {
"replace": [
{
"start": [
8,
30
],
"end": [
8,
31
]
},
{
"start": [
8,
32
],
"end": [
8,
33
]
}
]
},
"summary": "Replaced '5' with '6' in the j: 6 pair of the 'main' function"
},
{
"span": {
"replace": [
{
"start": [
9,
12
],
"end": [
9,
21
]
},
{
"start": [
9,
12
],
"end": [
9,
22
]
}
]
},
"summary": "Replaced the 'time.Time' qualified identifier with the 'time.Month' qualified identifier in the s3 var assignment of the 'main' function"
}
]
},
"errors": {}
},
"filePaths": [
"struct-literals.go"
],
"patch": [
"diff --git a/struct-literals.go b/struct-literals.go",
"index e6fd4f15..06724a46 100644",
"--- a/struct-literals.go",
"+++ b/struct-literals.go",
"@@ -1,10 +1,10 @@",
" package main",
" ",
" func main() {",
"-const s1 = Person{",
"+const s1 = Dog{",
" name: \"Frank\",",
" Age: \"5 months\",",
" }",
"-const s2 = struct{i int;}{i: 5}",
"-const s3 = time.Time{}",
"+const s2 = struct{i float;}{j: 6}",
"+const s3 = time.Month{}",
" }"
],
"gitDir": "test/corpus/repos/go",
"shas": "16546622d6d5c3abb229f1efd401797b70d45e78..0cb9ec3d83dc736d63d0bd8d950df9a9d5817f54"
}
,{
"testCaseDescription": "go-struct-literals-delete-replacement-test",
"expectedResult": {
"changes": {
"struct-literals.go": [
{
"span": {
"replace": [
{
"start": [
4,
12
],
"end": [
4,
15
]
},
{
"start": [
4,
12
],
"end": [
4,
18
]
}
]
},
"summary": "Replaced the 'Dog' identifier with the 'Person' identifier in the s1 var assignment of the 'main' function"
},
{
"span": {
"replace": [
{
"start": [
8,
21
],
"end": [
8,
26
]
},
{
"start": [
8,
21
],
"end": [
8,
24
]
}
]
},
"summary": "Replaced the 'float' identifier with the 'int' identifier in the struct{i int;} struct type of the 'main' function"
},
{
"span": {
"replace": [
{
"start": [
8,
29
],
"end": [
8,
30
]
},
{
"start": [
8,
27
],
"end": [
8,
28
]
}
]
},
"summary": "Replaced the 'j' identifier with the 'i' identifier in the i: 5 pair of the 'main' function"
},
{
"span": {
"replace": [
{
"start": [
8,
32
],
"end": [
8,
33
]
},
{
"start": [
8,
30
],
"end": [
8,
31
]
}
]
},
"summary": "Replaced '6' with '5' in the i: 5 pair of the 'main' function"
},
{
"span": {
"replace": [
{
"start": [
9,
12
],
"end": [
9,
22
]
},
{
"start": [
9,
12
],
"end": [
9,
21
]
}
]
},
"summary": "Replaced the 'time.Month' qualified identifier with the 'time.Time' qualified identifier in the s3 var assignment of the 'main' function"
}
]
},
"errors": {}
},
"filePaths": [
"struct-literals.go"
],
"patch": [
"diff --git a/struct-literals.go b/struct-literals.go",
"index 06724a46..e6fd4f15 100644",
"--- a/struct-literals.go",
"+++ b/struct-literals.go",
"@@ -1,10 +1,10 @@",
" package main",
" ",
" func main() {",
"-const s1 = Dog{",
"+const s1 = Person{",
" name: \"Frank\",",
" Age: \"5 months\",",
" }",
"-const s2 = struct{i float;}{j: 6}",
"-const s3 = time.Month{}",
"+const s2 = struct{i int;}{i: 5}",
"+const s3 = time.Time{}",
" }"
],
"gitDir": "test/corpus/repos/go",
"shas": "0cb9ec3d83dc736d63d0bd8d950df9a9d5817f54..ce0bf5c7a2ed66e66f174364a29682569e599a85"
}
,{
"testCaseDescription": "go-struct-literals-delete-insert-test",
"expectedResult": {
"changes": {
"struct-literals.go": [
{
"span": {
"delete": {
"start": [
4,
7
],
"end": [
7,
2
]
}
},
"summary": "Deleted the 's1' var assignment in the main function"
},
{
"span": {
"delete": {
"start": [
8,
7
],
"end": [
8,
32
]
}
},
"summary": "Deleted the 's2' var assignment in the main function"
},
{
"span": {
"delete": {
"start": [
9,
7
],
"end": [
9,
23
]
}
},
"summary": "Deleted the 's3' var assignment in the main function"
}
]
},
"errors": {}
},
"filePaths": [
"struct-literals.go"
],
"patch": [
"diff --git a/struct-literals.go b/struct-literals.go",
"index e6fd4f15..79058077 100644",
"--- a/struct-literals.go",
"+++ b/struct-literals.go",
"@@ -1,10 +1,5 @@",
" package main",
" ",
" func main() {",
"-const s1 = Person{",
"-name: \"Frank\",",
"-Age: \"5 months\",",
"-}",
"-const s2 = struct{i int;}{i: 5}",
"-const s3 = time.Time{}",
"+",
" }"
],
"gitDir": "test/corpus/repos/go",
"shas": "ce0bf5c7a2ed66e66f174364a29682569e599a85..59ec940f0880a6faa2cd6c22817b321149d8edac"
}
,{
"testCaseDescription": "go-struct-literals-teardown-test",
"expectedResult": {
"changes": {
"struct-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": [
"struct-literals.go"
],
"patch": [
"diff --git a/struct-literals.go b/struct-literals.go",
"index 79058077..e69de29b 100644",
"--- a/struct-literals.go",
"+++ b/struct-literals.go",
"@@ -1,5 +0,0 @@",
"-package main",
"-",
"-func main() {",
"-",
"-}"
],
"gitDir": "test/corpus/repos/go",
"shas": "59ec940f0880a6faa2cd6c22817b321149d8edac..bd83133c1e3a033c4f1414f48bd415a48fca1973"
}]