mirror of
https://github.com/github/semantic.git
synced 2024-12-23 14:54:16 +03:00
559 lines
18 KiB
JSON
559 lines
18 KiB
JSON
[{
|
|
"testCaseDescription": "go-slice-literals-setup-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"slice-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": [
|
|
"slice-literals.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/slice-literals.go b/slice-literals.go",
|
|
"index e69de29b..79058077 100644",
|
|
"--- a/slice-literals.go",
|
|
"+++ b/slice-literals.go",
|
|
"@@ -0,0 +1,5 @@",
|
|
"+package main",
|
|
"+",
|
|
"+func main() {",
|
|
"+",
|
|
"+}"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "8c647bd3f218e1592aa521ac3073922939c2814c..d4b43dfceead5a17f73e0d4aaf6e5a8dc275e85e"
|
|
}
|
|
,{
|
|
"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"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
5,
|
|
7
|
|
],
|
|
"end": [
|
|
5,
|
|
26
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 's2' var assignment in the main function"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
6,
|
|
7
|
|
],
|
|
"end": [
|
|
9,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 's3' var assignment in the main function"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"slice-literals.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/slice-literals.go b/slice-literals.go",
|
|
"index 79058077..3c94936e 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": "d4b43dfceead5a17f73e0d4aaf6e5a8dc275e85e..92c8106708f93a79b05854eb90182c6209441fb4"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-slice-literals-replacement-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"slice-literals.go": [
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
4,
|
|
20
|
|
],
|
|
"end": [
|
|
4,
|
|
22
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
4,
|
|
21
|
|
],
|
|
"end": [
|
|
4,
|
|
26
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the '{}' literal with the \"sup\" string in the []string\"sup\" composite_literal 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 []string\"hello\" composite_literal 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 []string\"bar\", \"baz\" composite_literal 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 []string\"bar\", \"baz\" composite_literal of the 'main' function"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"slice-literals.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/slice-literals.go b/slice-literals.go",
|
|
"index 3c94936e..caefc004 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": "92c8106708f93a79b05854eb90182c6209441fb4..5f614b9c887d58654717d6dd4372e6232a2030b4"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-slice-literals-delete-replacement-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"slice-literals.go": [
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
4,
|
|
21
|
|
],
|
|
"end": [
|
|
4,
|
|
26
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
4,
|
|
20
|
|
],
|
|
"end": [
|
|
4,
|
|
22
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the \"sup\" string with the '{}' literal in the []string{} composite_literal 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 []string\"hi\" composite_literal 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 []string\"hi\", \"hello\" composite_literal 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 []string\"hi\", \"hello\" composite_literal of the 'main' function"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"slice-literals.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/slice-literals.go b/slice-literals.go",
|
|
"index caefc004..3c94936e 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": "5f614b9c887d58654717d6dd4372e6232a2030b4..3834ba68eb6a5d8df4f39e088cf0c5820dd5ff1d"
|
|
}
|
|
,{
|
|
"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"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
5,
|
|
7
|
|
],
|
|
"end": [
|
|
5,
|
|
26
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 's2' var assignment in the main function"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
6,
|
|
7
|
|
],
|
|
"end": [
|
|
9,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 's3' var assignment in the main function"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"slice-literals.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/slice-literals.go b/slice-literals.go",
|
|
"index 3c94936e..79058077 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": "3834ba68eb6a5d8df4f39e088cf0c5820dd5ff1d..ba2bf2013e522a3d0d1ef7176b8640a820ca4670"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-slice-literals-teardown-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"slice-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": [
|
|
"slice-literals.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/slice-literals.go b/slice-literals.go",
|
|
"index 79058077..e69de29b 100644",
|
|
"--- a/slice-literals.go",
|
|
"+++ b/slice-literals.go",
|
|
"@@ -1,5 +0,0 @@",
|
|
"-package main",
|
|
"-",
|
|
"-func main() {",
|
|
"-",
|
|
"-}"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "ba2bf2013e522a3d0d1ef7176b8640a820ca4670..6a1ac7f651e7395fceb81ead8cb1338aacb11a8b"
|
|
}]
|