mirror of
https://github.com/github/semantic.git
synced 2024-12-23 23:11:50 +03:00
211 lines
5.7 KiB
JSON
211 lines
5.7 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": "cca816c1e5b231a02d0f79f0a410a9706f32a21d..d31de5bf4be1844f84deb13222c2ebb675c32208"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-slice-literals-insert-test",
|
|
"expectedResult": {
|
|
"changes": {},
|
|
"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": "d31de5bf4be1844f84deb13222c2ebb675c32208..ab94a2f902dff309c3a9339bbc119b0e7a9be910"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-slice-literals-replacement-test",
|
|
"expectedResult": {
|
|
"changes": {},
|
|
"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": "ab94a2f902dff309c3a9339bbc119b0e7a9be910..6a3c8a153bad5553a8a9e33b4397e39f330ae1b0"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-slice-literals-delete-replacement-test",
|
|
"expectedResult": {
|
|
"changes": {},
|
|
"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": "6a3c8a153bad5553a8a9e33b4397e39f330ae1b0..232ec2d9b4995a9006a692bdc03fb9e715f932eb"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-slice-literals-delete-insert-test",
|
|
"expectedResult": {
|
|
"changes": {},
|
|
"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": "232ec2d9b4995a9006a692bdc03fb9e715f932eb..c99b8aae11224e48938bb66b1af01272e4867da6"
|
|
}
|
|
,{
|
|
"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": "c99b8aae11224e48938bb66b1af01272e4867da6..919069e42d1645813da411bdab2621fea2098544"
|
|
}]
|