mirror of
https://github.com/github/semantic.git
synced 2024-12-23 23:11:50 +03:00
505 lines
16 KiB
JSON
505 lines
16 KiB
JSON
[{
|
|
"testCaseDescription": "go-slice-literals-setup-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"slice-literals.go": [
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
6,
|
|
1
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'main' module"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"slice-literals.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/slice-literals.go b/slice-literals.go",
|
|
"index e69de29..7905807 100644",
|
|
"--- a/slice-literals.go",
|
|
"+++ b/slice-literals.go",
|
|
"@@ -0,0 +1,5 @@",
|
|
"+package main",
|
|
"+",
|
|
"+func main() {",
|
|
"+",
|
|
"+}"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "250675f9851f6cab4d70c5505bc7781de836c288..199de168b62fa4e26885ccd7bdd8a3c78b2ca4cc"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-slice-literals-insert-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"slice-literals.go": [
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
4,
|
|
7
|
|
],
|
|
"end": [
|
|
4,
|
|
22
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 's1' var assignment in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
5,
|
|
7
|
|
],
|
|
"end": [
|
|
5,
|
|
26
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 's2' var assignment in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
6,
|
|
7
|
|
],
|
|
"end": [
|
|
9,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 's3' var assignment in the main function of the 'main' module"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"slice-literals.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/slice-literals.go b/slice-literals.go",
|
|
"index 7905807..3c94936 100644",
|
|
"--- a/slice-literals.go",
|
|
"+++ b/slice-literals.go",
|
|
"@@ -1,5 +1,10 @@",
|
|
" package main",
|
|
" ",
|
|
" func main() {",
|
|
"-",
|
|
"+const s1 = []string{}",
|
|
"+const s2 = []string{\"hi\"}",
|
|
"+const s3 = []string{",
|
|
"+\"hi\",",
|
|
"+ \"hello\",",
|
|
"+}",
|
|
" }"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "199de168b62fa4e26885ccd7bdd8a3c78b2ca4cc..5afce171f7961d5798c504c8a46f958229f9c904"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-slice-literals-replacement-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"slice-literals.go": [
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
4,
|
|
21
|
|
],
|
|
"end": [
|
|
4,
|
|
26
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the \"sup\" string in the s1 var assignment of the 'main' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
5,
|
|
21
|
|
],
|
|
"end": [
|
|
5,
|
|
25
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
5,
|
|
21
|
|
],
|
|
"end": [
|
|
5,
|
|
28
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the \"hi\" string with the \"hello\" string in the s2 var assignment of the 'main' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
7,
|
|
1
|
|
],
|
|
"end": [
|
|
7,
|
|
5
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
7,
|
|
1
|
|
],
|
|
"end": [
|
|
7,
|
|
6
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the \"hi\" string with the \"bar\" string in the s3 var assignment of the 'main' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
8,
|
|
2
|
|
],
|
|
"end": [
|
|
8,
|
|
9
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
8,
|
|
2
|
|
],
|
|
"end": [
|
|
8,
|
|
7
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the \"hello\" string with the \"baz\" string in the s3 var assignment of the 'main' function"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"slice-literals.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/slice-literals.go b/slice-literals.go",
|
|
"index 3c94936..caefc00 100644",
|
|
"--- a/slice-literals.go",
|
|
"+++ b/slice-literals.go",
|
|
"@@ -1,10 +1,10 @@",
|
|
" package main",
|
|
" ",
|
|
" func main() {",
|
|
"-const s1 = []string{}",
|
|
"-const s2 = []string{\"hi\"}",
|
|
"+const s1 = []string{\"sup\"}",
|
|
"+const s2 = []string{\"hello\"}",
|
|
" const s3 = []string{",
|
|
"-\"hi\",",
|
|
"- \"hello\",",
|
|
"+\"bar\",",
|
|
"+ \"baz\",",
|
|
" }",
|
|
" }"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "5afce171f7961d5798c504c8a46f958229f9c904..c8dc6adac5c86321f51b6c0eaff1e9172bb393b8"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-slice-literals-delete-replacement-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"slice-literals.go": [
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
4,
|
|
21
|
|
],
|
|
"end": [
|
|
4,
|
|
26
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the \"sup\" string in the s1 var assignment of the 'main' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
5,
|
|
21
|
|
],
|
|
"end": [
|
|
5,
|
|
28
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
5,
|
|
21
|
|
],
|
|
"end": [
|
|
5,
|
|
25
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the \"hello\" string with the \"hi\" string in the s2 var assignment of the 'main' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
7,
|
|
1
|
|
],
|
|
"end": [
|
|
7,
|
|
6
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
7,
|
|
1
|
|
],
|
|
"end": [
|
|
7,
|
|
5
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the \"bar\" string with the \"hi\" string in the s3 var assignment of the 'main' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
8,
|
|
2
|
|
],
|
|
"end": [
|
|
8,
|
|
7
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
8,
|
|
2
|
|
],
|
|
"end": [
|
|
8,
|
|
9
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the \"baz\" string with the \"hello\" string in the s3 var assignment of the 'main' function"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"slice-literals.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/slice-literals.go b/slice-literals.go",
|
|
"index caefc00..3c94936 100644",
|
|
"--- a/slice-literals.go",
|
|
"+++ b/slice-literals.go",
|
|
"@@ -1,10 +1,10 @@",
|
|
" package main",
|
|
" ",
|
|
" func main() {",
|
|
"-const s1 = []string{\"sup\"}",
|
|
"-const s2 = []string{\"hello\"}",
|
|
"+const s1 = []string{}",
|
|
"+const s2 = []string{\"hi\"}",
|
|
" const s3 = []string{",
|
|
"-\"bar\",",
|
|
"- \"baz\",",
|
|
"+\"hi\",",
|
|
"+ \"hello\",",
|
|
" }",
|
|
" }"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "c8dc6adac5c86321f51b6c0eaff1e9172bb393b8..969119894d612e7e3be07f22a9009ced6205cf15"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-slice-literals-delete-insert-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"slice-literals.go": [
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
4,
|
|
7
|
|
],
|
|
"end": [
|
|
4,
|
|
22
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 's1' var assignment in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
5,
|
|
7
|
|
],
|
|
"end": [
|
|
5,
|
|
26
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 's2' var assignment in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
6,
|
|
7
|
|
],
|
|
"end": [
|
|
9,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 's3' var assignment in the main function of the 'main' module"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"slice-literals.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/slice-literals.go b/slice-literals.go",
|
|
"index 3c94936..7905807 100644",
|
|
"--- a/slice-literals.go",
|
|
"+++ b/slice-literals.go",
|
|
"@@ -1,10 +1,5 @@",
|
|
" package main",
|
|
" ",
|
|
" func main() {",
|
|
"-const s1 = []string{}",
|
|
"-const s2 = []string{\"hi\"}",
|
|
"-const s3 = []string{",
|
|
"-\"hi\",",
|
|
"- \"hello\",",
|
|
"-}",
|
|
"+",
|
|
" }"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "969119894d612e7e3be07f22a9009ced6205cf15..4637438856ddb94e3c4a3e15572825cf0cf9218f"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-slice-literals-teardown-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"slice-literals.go": [
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
6,
|
|
1
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'main' module"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"slice-literals.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/slice-literals.go b/slice-literals.go",
|
|
"index 7905807..e69de29 100644",
|
|
"--- a/slice-literals.go",
|
|
"+++ b/slice-literals.go",
|
|
"@@ -1,5 +0,0 @@",
|
|
"-package main",
|
|
"-",
|
|
"-func main() {",
|
|
"-",
|
|
"-}"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "4637438856ddb94e3c4a3e15572825cf0cf9218f..ede817f2d69f14475f354045064794e04a6bfec8"
|
|
}]
|