1
1
mirror of https://github.com/github/semantic.git synced 2024-12-26 00:12:29 +03:00
semantic/test/corpus/diff-summaries/go/single-import-declarations.json
2017-01-17 15:26:07 -05:00

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 e69de29b..79058077 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": "e3cdff1e6a1723aecba4ee8116ae8b30419a85f0..a93f888c54ec7619047dd94f045f8101a995814e"
}
,{
"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 79058077..bf7f515f 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": "a93f888c54ec7619047dd94f045f8101a995814e..d34f33b885ff14ebcb2403eda6bfbfff0058dbb0"
}
,{
"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 bf7f515f..7710f5e3 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": "d34f33b885ff14ebcb2403eda6bfbfff0058dbb0..ebfec37f4d62416c03bab8ed9696845eb85b5aae"
}
,{
"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 7710f5e3..bf7f515f 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": "ebfec37f4d62416c03bab8ed9696845eb85b5aae..9cba47bb212d7f1dc489500c760832e2df679c83"
}
,{
"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 bf7f515f..79058077 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": "9cba47bb212d7f1dc489500c760832e2df679c83..1d5875c53cb7248a6a42b0a5e68abd8f17dcf19d"
}
,{
"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 79058077..e69de29b 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": "1d5875c53cb7248a6a42b0a5e68abd8f17dcf19d..e13c25cd435aead827b8a09d18dfed061d9f8443"
}]