mirror of
https://github.com/github/semantic.git
synced 2024-12-24 23:42:31 +03:00
813 lines
26 KiB
JSON
813 lines
26 KiB
JSON
[{
|
|
"testCaseDescription": "go-slice-literals-insert-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"slice-literals.go": [
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
1,
|
|
22
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 's1' variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
2,
|
|
1
|
|
],
|
|
"end": [
|
|
2,
|
|
26
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 's2' variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
3,
|
|
1
|
|
],
|
|
"end": [
|
|
6,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 's3' variable"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"slice-literals.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/slice-literals.go b/slice-literals.go",
|
|
"index e69de29..9b1eb7a 100644",
|
|
"--- a/slice-literals.go",
|
|
"+++ b/slice-literals.go",
|
|
"@@ -0,0 +1,6 @@",
|
|
"+const s1 = []string{}",
|
|
"+const s2 = []string{\"hi\"}",
|
|
"+const s3 = []string{",
|
|
"+\"hi\",",
|
|
"+ \"hello\",",
|
|
"+}"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "a265d67025ede03db426cc6c2fd380842a72197b..46dcfe47584becc991bfd8404dcbf2234a807fde"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-slice-literals-replacement-insert-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"slice-literals.go": [
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
1,
|
|
27
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 's1' variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
2,
|
|
1
|
|
],
|
|
"end": [
|
|
2,
|
|
29
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 's2' variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
3,
|
|
1
|
|
],
|
|
"end": [
|
|
6,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 's3' variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
7,
|
|
1
|
|
],
|
|
"end": [
|
|
7,
|
|
22
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 's1' variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
8,
|
|
1
|
|
],
|
|
"end": [
|
|
8,
|
|
26
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 's2' variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
9,
|
|
1
|
|
],
|
|
"end": [
|
|
12,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 's3' variable"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"slice-literals.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/slice-literals.go b/slice-literals.go",
|
|
"index 9b1eb7a..4555163 100644",
|
|
"--- a/slice-literals.go",
|
|
"+++ b/slice-literals.go",
|
|
"@@ -1,3 +1,15 @@",
|
|
"+const s1 = []string{\"sup\"}",
|
|
"+const s2 = []string{\"hello\"}",
|
|
"+const s3 = []string{",
|
|
"+\"bar\",",
|
|
"+ \"baz\",",
|
|
"+}",
|
|
"+const s1 = []string{}",
|
|
"+const s2 = []string{\"hi\"}",
|
|
"+const s3 = []string{",
|
|
"+\"hi\",",
|
|
"+ \"hello\",",
|
|
"+}",
|
|
" const s1 = []string{}",
|
|
" const s2 = []string{\"hi\"}",
|
|
" const s3 = []string{"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "46dcfe47584becc991bfd8404dcbf2234a807fde..c8478f8b70fe205de35b3f6350d07587eb0bd43d"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-slice-literals-delete-insert-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"slice-literals.go": [
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
1,
|
|
21
|
|
],
|
|
"end": [
|
|
1,
|
|
26
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
1,
|
|
20
|
|
],
|
|
"end": [
|
|
1,
|
|
22
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the \"sup\" string with the '{}' literal_value in the s1 variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
2,
|
|
21
|
|
],
|
|
"end": [
|
|
2,
|
|
28
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
2,
|
|
21
|
|
],
|
|
"end": [
|
|
2,
|
|
25
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the \"hello\" string with the \"hi\" string in the s2 variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
4,
|
|
1
|
|
],
|
|
"end": [
|
|
4,
|
|
6
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
4,
|
|
1
|
|
],
|
|
"end": [
|
|
4,
|
|
5
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the \"bar\" string with the \"hi\" string in the s3 variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
5,
|
|
2
|
|
],
|
|
"end": [
|
|
5,
|
|
7
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
5,
|
|
2
|
|
],
|
|
"end": [
|
|
5,
|
|
9
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the \"baz\" string with the \"hello\" string in the s3 variable"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"slice-literals.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/slice-literals.go b/slice-literals.go",
|
|
"index 4555163..39a2067 100644",
|
|
"--- a/slice-literals.go",
|
|
"+++ b/slice-literals.go",
|
|
"@@ -1,8 +1,8 @@",
|
|
"-const s1 = []string{\"sup\"}",
|
|
"-const s2 = []string{\"hello\"}",
|
|
"+const s1 = []string{}",
|
|
"+const s2 = []string{\"hi\"}",
|
|
" const s3 = []string{",
|
|
"-\"bar\",",
|
|
"- \"baz\",",
|
|
"+\"hi\",",
|
|
"+ \"hello\",",
|
|
" }",
|
|
" const s1 = []string{}",
|
|
" const s2 = []string{\"hi\"}"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "c8478f8b70fe205de35b3f6350d07587eb0bd43d..f0302c27d0841249d2f7f11aa9519cbec4f79a1c"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-slice-literals-replacement-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"slice-literals.go": [
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
1,
|
|
20
|
|
],
|
|
"end": [
|
|
1,
|
|
22
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
1,
|
|
21
|
|
],
|
|
"end": [
|
|
1,
|
|
26
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the '{}' literal_value with the \"sup\" string in the s1 variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
2,
|
|
21
|
|
],
|
|
"end": [
|
|
2,
|
|
25
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
2,
|
|
21
|
|
],
|
|
"end": [
|
|
2,
|
|
28
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the \"hi\" string with the \"hello\" string in the s2 variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
4,
|
|
1
|
|
],
|
|
"end": [
|
|
4,
|
|
5
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
4,
|
|
1
|
|
],
|
|
"end": [
|
|
4,
|
|
6
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the \"hi\" string with the \"bar\" string in the s3 variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
5,
|
|
2
|
|
],
|
|
"end": [
|
|
5,
|
|
9
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
5,
|
|
2
|
|
],
|
|
"end": [
|
|
5,
|
|
7
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the \"hello\" string with the \"baz\" string in the s3 variable"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"slice-literals.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/slice-literals.go b/slice-literals.go",
|
|
"index 39a2067..4555163 100644",
|
|
"--- a/slice-literals.go",
|
|
"+++ b/slice-literals.go",
|
|
"@@ -1,8 +1,8 @@",
|
|
"-const s1 = []string{}",
|
|
"-const s2 = []string{\"hi\"}",
|
|
"+const s1 = []string{\"sup\"}",
|
|
"+const s2 = []string{\"hello\"}",
|
|
" const s3 = []string{",
|
|
"-\"hi\",",
|
|
"- \"hello\",",
|
|
"+\"bar\",",
|
|
"+ \"baz\",",
|
|
" }",
|
|
" const s1 = []string{}",
|
|
" const s2 = []string{\"hi\"}"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "f0302c27d0841249d2f7f11aa9519cbec4f79a1c..9ce3c27c8bc080f1aaf7ccbef16ed54efe60b866"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-slice-literals-delete-replacement-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"slice-literals.go": [
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
1,
|
|
27
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 's1' variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
2,
|
|
1
|
|
],
|
|
"end": [
|
|
2,
|
|
29
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 's2' variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
3,
|
|
1
|
|
],
|
|
"end": [
|
|
6,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 's3' variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
7,
|
|
1
|
|
],
|
|
"end": [
|
|
7,
|
|
22
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 's1' variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
8,
|
|
1
|
|
],
|
|
"end": [
|
|
8,
|
|
26
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 's2' variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
9,
|
|
1
|
|
],
|
|
"end": [
|
|
12,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 's3' variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
7,
|
|
1
|
|
],
|
|
"end": [
|
|
7,
|
|
27
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 's1' variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
8,
|
|
1
|
|
],
|
|
"end": [
|
|
8,
|
|
29
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 's2' variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
9,
|
|
1
|
|
],
|
|
"end": [
|
|
12,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 's3' variable"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"slice-literals.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/slice-literals.go b/slice-literals.go",
|
|
"index 4555163..d3fb29c 100644",
|
|
"--- a/slice-literals.go",
|
|
"+++ b/slice-literals.go",
|
|
"@@ -1,18 +1,12 @@",
|
|
"-const s1 = []string{\"sup\"}",
|
|
"-const s2 = []string{\"hello\"}",
|
|
"-const s3 = []string{",
|
|
"-\"bar\",",
|
|
"- \"baz\",",
|
|
"-}",
|
|
" const s1 = []string{}",
|
|
" const s2 = []string{\"hi\"}",
|
|
" const s3 = []string{",
|
|
" \"hi\",",
|
|
" \"hello\",",
|
|
" }",
|
|
"-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": "9ce3c27c8bc080f1aaf7ccbef16ed54efe60b866..6477f5e091ba80c09675904df7fbe2a60ce42e48"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-slice-literals-delete-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"slice-literals.go": [
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
1,
|
|
22
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 's1' variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
2,
|
|
1
|
|
],
|
|
"end": [
|
|
2,
|
|
26
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 's2' variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
3,
|
|
1
|
|
],
|
|
"end": [
|
|
6,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 's3' variable"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"slice-literals.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/slice-literals.go b/slice-literals.go",
|
|
"index d3fb29c..e3fd378 100644",
|
|
"--- a/slice-literals.go",
|
|
"+++ b/slice-literals.go",
|
|
"@@ -1,9 +1,3 @@",
|
|
"-const s1 = []string{}",
|
|
"-const s2 = []string{\"hi\"}",
|
|
"-const s3 = []string{",
|
|
"-\"hi\",",
|
|
"- \"hello\",",
|
|
"-}",
|
|
" const s1 = []string{\"sup\"}",
|
|
" const s2 = []string{\"hello\"}",
|
|
" const s3 = []string{"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "6477f5e091ba80c09675904df7fbe2a60ce42e48..73c2189e2fe3c54d98e166d6b2de19b4c1cf84a6"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-slice-literals-delete-rest-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"slice-literals.go": [
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
1,
|
|
27
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 's1' variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
2,
|
|
1
|
|
],
|
|
"end": [
|
|
2,
|
|
29
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 's2' variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
3,
|
|
1
|
|
],
|
|
"end": [
|
|
6,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 's3' variable"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"slice-literals.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/slice-literals.go b/slice-literals.go",
|
|
"index e3fd378..e69de29 100644",
|
|
"--- a/slice-literals.go",
|
|
"+++ b/slice-literals.go",
|
|
"@@ -1,6 +0,0 @@",
|
|
"-const s1 = []string{\"sup\"}",
|
|
"-const s2 = []string{\"hello\"}",
|
|
"-const s3 = []string{",
|
|
"-\"bar\",",
|
|
"- \"baz\",",
|
|
"-}"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "73c2189e2fe3c54d98e166d6b2de19b4c1cf84a6..62b3bd21fe70e211cf5e78be3146344161dec77a"
|
|
}]
|