mirror of
https://github.com/github/semantic.git
synced 2024-12-27 08:54:14 +03:00
591 lines
19 KiB
JSON
591 lines
19 KiB
JSON
[{
|
|
"testCaseDescription": "go-indexing-expressions-setup-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"indexing-expressions.go": [
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
6,
|
|
1
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'main' module"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"indexing-expressions.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/indexing-expressions.go b/indexing-expressions.go",
|
|
"index e69de29..7905807 100644",
|
|
"--- a/indexing-expressions.go",
|
|
"+++ b/indexing-expressions.go",
|
|
"@@ -0,0 +1,5 @@",
|
|
"+package main",
|
|
"+",
|
|
"+func main() {",
|
|
"+",
|
|
"+}"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "512f678e80270a7b8c148ffbf16d83ef76c20e46..b7f33fe57b2843f65d9a5bf09b212e11b79fc64c"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-indexing-expressions-insert-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"indexing-expressions.go": [
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
4,
|
|
1
|
|
],
|
|
"end": [
|
|
4,
|
|
5
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'a[1]' subscript access in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
5,
|
|
2
|
|
],
|
|
"end": [
|
|
5,
|
|
6
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'b[b[:]]' subscript access in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
6,
|
|
2
|
|
],
|
|
"end": [
|
|
6,
|
|
7
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'c[1]' subscript access in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
7,
|
|
2
|
|
],
|
|
"end": [
|
|
7,
|
|
8
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'd[1:2]' subscript access in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
8,
|
|
2
|
|
],
|
|
"end": [
|
|
8,
|
|
9
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'e[2:3]' subscript access in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
9,
|
|
2
|
|
],
|
|
"end": [
|
|
9,
|
|
10
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'f[1:2:3]' subscript access in the main function of the 'main' module"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"indexing-expressions.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/indexing-expressions.go b/indexing-expressions.go",
|
|
"index 7905807..c2c7693 100644",
|
|
"--- a/indexing-expressions.go",
|
|
"+++ b/indexing-expressions.go",
|
|
"@@ -1,5 +1,10 @@",
|
|
" package main",
|
|
" ",
|
|
" func main() {",
|
|
"-",
|
|
"+a[1]",
|
|
"+ b[:]",
|
|
"+ c[1:]",
|
|
"+ d[1:2]",
|
|
"+ e[:2:3]",
|
|
"+ f[1:2:3]",
|
|
" }"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "b7f33fe57b2843f65d9a5bf09b212e11b79fc64c..f1fa7489c4ce69342b25c4e99405810edb6a557a"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-indexing-expressions-replacement-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"indexing-expressions.go": [
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
4,
|
|
1
|
|
],
|
|
"end": [
|
|
4,
|
|
5
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
4,
|
|
1
|
|
],
|
|
"end": [
|
|
4,
|
|
6
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'a[1]' subscript access with the 'z[2]' subscript access in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
5,
|
|
2
|
|
],
|
|
"end": [
|
|
5,
|
|
3
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
5,
|
|
2
|
|
],
|
|
"end": [
|
|
5,
|
|
3
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'b' identifier with the 'y' identifier in the y[1] subscript access of the 'main' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
5,
|
|
5
|
|
],
|
|
"end": [
|
|
5,
|
|
6
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added '1' in the y[1] subscript access of the 'main' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
6,
|
|
2
|
|
],
|
|
"end": [
|
|
6,
|
|
3
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
6,
|
|
2
|
|
],
|
|
"end": [
|
|
6,
|
|
3
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'c' identifier with the 'x' identifier in the x[1] subscript access of the 'main' function"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"indexing-expressions.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/indexing-expressions.go b/indexing-expressions.go",
|
|
"index c2c7693..68a7634 100644",
|
|
"--- a/indexing-expressions.go",
|
|
"+++ b/indexing-expressions.go",
|
|
"@@ -1,9 +1,9 @@",
|
|
" package main",
|
|
" ",
|
|
" func main() {",
|
|
"-a[1]",
|
|
"- b[:]",
|
|
"- c[1:]",
|
|
"+z[:2]",
|
|
"+ y[:1]",
|
|
"+ x[1:]",
|
|
" d[1:2]",
|
|
" e[:2:3]",
|
|
" f[1:2:3]"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "f1fa7489c4ce69342b25c4e99405810edb6a557a..1519cd9ebd082bd97ef7661a7ff7d4ab8f2dd0aa"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-indexing-expressions-delete-replacement-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"indexing-expressions.go": [
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
4,
|
|
1
|
|
],
|
|
"end": [
|
|
4,
|
|
6
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
4,
|
|
1
|
|
],
|
|
"end": [
|
|
4,
|
|
5
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'z[2]' subscript access with the 'a[1]' subscript access in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
5,
|
|
2
|
|
],
|
|
"end": [
|
|
5,
|
|
3
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
5,
|
|
2
|
|
],
|
|
"end": [
|
|
5,
|
|
3
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'y' identifier with the 'b' identifier in the b[b[:]] subscript access of the 'main' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
5,
|
|
5
|
|
],
|
|
"end": [
|
|
5,
|
|
6
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted '1' in the b[b[:]] subscript access of the 'main' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
6,
|
|
2
|
|
],
|
|
"end": [
|
|
6,
|
|
3
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
6,
|
|
2
|
|
],
|
|
"end": [
|
|
6,
|
|
3
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'x' identifier with the 'c' identifier in the c[1] subscript access of the 'main' function"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"indexing-expressions.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/indexing-expressions.go b/indexing-expressions.go",
|
|
"index 68a7634..c2c7693 100644",
|
|
"--- a/indexing-expressions.go",
|
|
"+++ b/indexing-expressions.go",
|
|
"@@ -1,9 +1,9 @@",
|
|
" package main",
|
|
" ",
|
|
" func main() {",
|
|
"-z[:2]",
|
|
"- y[:1]",
|
|
"- x[1:]",
|
|
"+a[1]",
|
|
"+ b[:]",
|
|
"+ c[1:]",
|
|
" d[1:2]",
|
|
" e[:2:3]",
|
|
" f[1:2:3]"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "1519cd9ebd082bd97ef7661a7ff7d4ab8f2dd0aa..e6c6a419dc0bfbea00409f46746afdfe8e03d207"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-indexing-expressions-delete-insert-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"indexing-expressions.go": [
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
4,
|
|
1
|
|
],
|
|
"end": [
|
|
4,
|
|
5
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'a[1]' subscript access in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
5,
|
|
2
|
|
],
|
|
"end": [
|
|
5,
|
|
6
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'b[b[:]]' subscript access in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
6,
|
|
2
|
|
],
|
|
"end": [
|
|
6,
|
|
7
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'c[1]' subscript access in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
7,
|
|
2
|
|
],
|
|
"end": [
|
|
7,
|
|
8
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'd[1:2]' subscript access in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
8,
|
|
2
|
|
],
|
|
"end": [
|
|
8,
|
|
9
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'e[2:3]' subscript access in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
9,
|
|
2
|
|
],
|
|
"end": [
|
|
9,
|
|
10
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'f[1:2:3]' subscript access in the main function of the 'main' module"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"indexing-expressions.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/indexing-expressions.go b/indexing-expressions.go",
|
|
"index c2c7693..7905807 100644",
|
|
"--- a/indexing-expressions.go",
|
|
"+++ b/indexing-expressions.go",
|
|
"@@ -1,10 +1,5 @@",
|
|
" package main",
|
|
" ",
|
|
" func main() {",
|
|
"-a[1]",
|
|
"- b[:]",
|
|
"- c[1:]",
|
|
"- d[1:2]",
|
|
"- e[:2:3]",
|
|
"- f[1:2:3]",
|
|
"+",
|
|
" }"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "e6c6a419dc0bfbea00409f46746afdfe8e03d207..4044902333655e29933b3f406c2c24c673e17834"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-indexing-expressions-teardown-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"indexing-expressions.go": [
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
6,
|
|
1
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'main' module"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"indexing-expressions.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/indexing-expressions.go b/indexing-expressions.go",
|
|
"index 7905807..e69de29 100644",
|
|
"--- a/indexing-expressions.go",
|
|
"+++ b/indexing-expressions.go",
|
|
"@@ -1,5 +0,0 @@",
|
|
"-package main",
|
|
"-",
|
|
"-func main() {",
|
|
"-",
|
|
"-}"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "4044902333655e29933b3f406c2c24c673e17834..4787ffbe0a99ff9ebdab0557183ad6663dd746cb"
|
|
}]
|