mirror of
https://github.com/github/semantic.git
synced 2024-12-25 16:02:43 +03:00
581 lines
20 KiB
JSON
581 lines
20 KiB
JSON
[{
|
|
"testCaseDescription": "go-single-import-declarations-setup-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"single-import-declarations.go": [
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
6,
|
|
1
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'main' module"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"single-import-declarations.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/single-import-declarations.go b/single-import-declarations.go",
|
|
"index e69de29..7905807 100644",
|
|
"--- a/single-import-declarations.go",
|
|
"+++ b/single-import-declarations.go",
|
|
"@@ -0,0 +1,5 @@",
|
|
"+package main",
|
|
"+",
|
|
"+func main() {",
|
|
"+",
|
|
"+}"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "b2c94865de12a0fe3e8ffd586be8365f6594785d..c5ebbdfbcee67ce070589c296508b88d48e4ec92"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-single-import-declarations-insert-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"single-import-declarations.go": [
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
4,
|
|
1
|
|
],
|
|
"end": [
|
|
4,
|
|
7
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'import' identifier in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
4,
|
|
8
|
|
],
|
|
"end": [
|
|
4,
|
|
18
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the \"net/http\" string in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
5,
|
|
1
|
|
],
|
|
"end": [
|
|
5,
|
|
7
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'import' identifier in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
5,
|
|
10
|
|
],
|
|
"end": [
|
|
5,
|
|
20
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the \"some/dsl\" string in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
6,
|
|
1
|
|
],
|
|
"end": [
|
|
6,
|
|
7
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'import' identifier in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
6,
|
|
8
|
|
],
|
|
"end": [
|
|
6,
|
|
13
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'alias' identifier in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
6,
|
|
14
|
|
],
|
|
"end": [
|
|
6,
|
|
28
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the \"some/package\" string in the main function of the 'main' module"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"single-import-declarations.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/single-import-declarations.go b/single-import-declarations.go",
|
|
"index 7905807..bf7f515 100644",
|
|
"--- a/single-import-declarations.go",
|
|
"+++ b/single-import-declarations.go",
|
|
"@@ -1,5 +1,7 @@",
|
|
" package main",
|
|
" ",
|
|
" func main() {",
|
|
"-",
|
|
"+import \"net/http\"",
|
|
"+import . \"some/dsl\"",
|
|
"+import alias \"some/package\"",
|
|
" }"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "c5ebbdfbcee67ce070589c296508b88d48e4ec92..023c7a8283c8c39743bf34d453118be675ce2a62"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-single-import-declarations-replacement-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"single-import-declarations.go": [
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
4,
|
|
8
|
|
],
|
|
"end": [
|
|
4,
|
|
18
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
4,
|
|
8
|
|
],
|
|
"end": [
|
|
4,
|
|
17
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the \"net/http\" string with the \"foo/bar\" string in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
5,
|
|
10
|
|
],
|
|
"end": [
|
|
5,
|
|
20
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
5,
|
|
10
|
|
],
|
|
"end": [
|
|
5,
|
|
21
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the \"some/dsl\" string with the \"types/dsl\" string in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
6,
|
|
14
|
|
],
|
|
"end": [
|
|
6,
|
|
28
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
6,
|
|
14
|
|
],
|
|
"end": [
|
|
6,
|
|
32
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the \"some/package\" string with the \"awesome/packages\" string in the main function of the 'main' module"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"single-import-declarations.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/single-import-declarations.go b/single-import-declarations.go",
|
|
"index bf7f515..7710f5e 100644",
|
|
"--- a/single-import-declarations.go",
|
|
"+++ b/single-import-declarations.go",
|
|
"@@ -1,7 +1,7 @@",
|
|
" package main",
|
|
" ",
|
|
" func main() {",
|
|
"-import \"net/http\"",
|
|
"-import . \"some/dsl\"",
|
|
"-import alias \"some/package\"",
|
|
"+import \"foo/bar\"",
|
|
"+import . \"types/dsl\"",
|
|
"+import alias \"awesome/packages\"",
|
|
" }"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "023c7a8283c8c39743bf34d453118be675ce2a62..e2cc79d0d56c1d3fc36bee338a29a2c9a59b2cfb"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-single-import-declarations-delete-replacement-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"single-import-declarations.go": [
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
4,
|
|
8
|
|
],
|
|
"end": [
|
|
4,
|
|
17
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
4,
|
|
8
|
|
],
|
|
"end": [
|
|
4,
|
|
18
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the \"foo/bar\" string with the \"net/http\" string in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
5,
|
|
10
|
|
],
|
|
"end": [
|
|
5,
|
|
21
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
5,
|
|
10
|
|
],
|
|
"end": [
|
|
5,
|
|
20
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the \"types/dsl\" string with the \"some/dsl\" string in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
6,
|
|
14
|
|
],
|
|
"end": [
|
|
6,
|
|
32
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
6,
|
|
14
|
|
],
|
|
"end": [
|
|
6,
|
|
28
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the \"awesome/packages\" string with the \"some/package\" string in the main function of the 'main' module"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"single-import-declarations.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/single-import-declarations.go b/single-import-declarations.go",
|
|
"index 7710f5e..bf7f515 100644",
|
|
"--- a/single-import-declarations.go",
|
|
"+++ b/single-import-declarations.go",
|
|
"@@ -1,7 +1,7 @@",
|
|
" package main",
|
|
" ",
|
|
" func main() {",
|
|
"-import \"foo/bar\"",
|
|
"-import . \"types/dsl\"",
|
|
"-import alias \"awesome/packages\"",
|
|
"+import \"net/http\"",
|
|
"+import . \"some/dsl\"",
|
|
"+import alias \"some/package\"",
|
|
" }"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "e2cc79d0d56c1d3fc36bee338a29a2c9a59b2cfb..66601a8b18770a968a55d8f1b4b756d99f86fa6f"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-single-import-declarations-delete-insert-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"single-import-declarations.go": [
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
4,
|
|
1
|
|
],
|
|
"end": [
|
|
4,
|
|
7
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'import' identifier in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
4,
|
|
8
|
|
],
|
|
"end": [
|
|
4,
|
|
18
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the \"net/http\" string in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
5,
|
|
1
|
|
],
|
|
"end": [
|
|
5,
|
|
7
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'import' identifier in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
5,
|
|
10
|
|
],
|
|
"end": [
|
|
5,
|
|
20
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the \"some/dsl\" string in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
6,
|
|
1
|
|
],
|
|
"end": [
|
|
6,
|
|
7
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'import' identifier in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
6,
|
|
8
|
|
],
|
|
"end": [
|
|
6,
|
|
13
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'alias' identifier in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
6,
|
|
14
|
|
],
|
|
"end": [
|
|
6,
|
|
28
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the \"some/package\" string in the main function of the 'main' module"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"single-import-declarations.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/single-import-declarations.go b/single-import-declarations.go",
|
|
"index bf7f515..7905807 100644",
|
|
"--- a/single-import-declarations.go",
|
|
"+++ b/single-import-declarations.go",
|
|
"@@ -1,7 +1,5 @@",
|
|
" package main",
|
|
" ",
|
|
" func main() {",
|
|
"-import \"net/http\"",
|
|
"-import . \"some/dsl\"",
|
|
"-import alias \"some/package\"",
|
|
"+",
|
|
" }"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "66601a8b18770a968a55d8f1b4b756d99f86fa6f..c7adb04aaca03412711493554030a4fa69717dff"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-single-import-declarations-teardown-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"single-import-declarations.go": [
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
6,
|
|
1
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'main' module"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"single-import-declarations.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/single-import-declarations.go b/single-import-declarations.go",
|
|
"index 7905807..e69de29 100644",
|
|
"--- a/single-import-declarations.go",
|
|
"+++ b/single-import-declarations.go",
|
|
"@@ -1,5 +0,0 @@",
|
|
"-package main",
|
|
"-",
|
|
"-func main() {",
|
|
"-",
|
|
"-}"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "c7adb04aaca03412711493554030a4fa69717dff..d676b32b8feeb558a1e03b0708734ad55e01ca88"
|
|
}]
|