1
1
mirror of https://github.com/github/semantic.git synced 2024-12-23 14:54:16 +03:00
semantic/test/corpus/diff-summaries/go/function-declarations.json
2017-01-10 15:09:09 -05:00

485 lines
16 KiB
JSON

[{
"testCaseDescription": "go-function-declarations-setup-test",
"expectedResult": {
"changes": {
"function-declarations.go": [
{
"span": {
"insert": {
"start": [
1,
1
],
"end": [
6,
1
]
}
},
"summary": "Added the 'main' module"
}
]
},
"errors": {}
},
"filePaths": [
"function-declarations.go"
],
"patch": [
"diff --git a/function-declarations.go b/function-declarations.go",
"index e69de29..7905807 100644",
"--- a/function-declarations.go",
"+++ b/function-declarations.go",
"@@ -0,0 +1,5 @@",
"+package main",
"+",
"+func main() {",
"+",
"+}"
],
"gitDir": "test/corpus/repos/go",
"shas": "5ee82082a46c778d2d73f23d2d266ea19676839a..3b2d0f344948eb8d8861c6095c84a84f4892cd5f"
}
,{
"testCaseDescription": "go-function-declarations-insert-test",
"expectedResult": {
"changes": {
"function-declarations.go": [
{
"span": {
"replace": [
{
"start": [
1,
1
],
"end": [
6,
1
]
},
{
"start": [
1,
1
],
"end": [
8,
1
]
}
]
},
"summary": "Replaced the 'main' module with the 'main' module"
}
]
},
"errors": {}
},
"filePaths": [
"function-declarations.go"
],
"patch": [
"diff --git a/function-declarations.go b/function-declarations.go",
"index 7905807..2a1e7b8 100644",
"--- a/function-declarations.go",
"+++ b/function-declarations.go",
"@@ -1,5 +1,8 @@",
" package main",
" ",
" func main() {",
"-",
"+func f1() {}",
"+func f2(a int, b, c, d string) int {}",
"+func f2() (int, error) {}",
"+func f2() (result int, err error) {}",
" }"
],
"gitDir": "test/corpus/repos/go",
"shas": "3b2d0f344948eb8d8861c6095c84a84f4892cd5f..d22e3d1c200a31f80f84a10c1179f07fcdb1338a"
}
,{
"testCaseDescription": "go-function-declarations-replacement-test",
"expectedResult": {
"changes": {
"function-declarations.go": [
{
"span": {
"replace": [
{
"start": [
4,
6
],
"end": [
4,
8
]
},
{
"start": [
4,
6
],
"end": [
4,
8
]
}
]
},
"summary": "Replaced the 'f1' identifier with the 'fa' identifier in the fa() function call of the 'main' function"
},
{
"span": {
"replace": [
{
"start": [
5,
6
],
"end": [
5,
8
]
},
{
"start": [
5,
6
],
"end": [
5,
8
]
}
]
},
"summary": "Replaced the 'f2' identifier with the 'fb' identifier in the main module"
},
{
"span": {
"replace": [
{
"start": [
6,
6
],
"end": [
6,
8
]
},
{
"start": [
6,
6
],
"end": [
6,
8
]
}
]
},
"summary": "Replaced the 'f2' identifier with the 'fc' identifier in the main module"
},
{
"span": {
"replace": [
{
"start": [
7,
6
],
"end": [
7,
8
]
},
{
"start": [
7,
6
],
"end": [
7,
8
]
}
]
},
"summary": "Replaced the 'f2' identifier with the 'fd' identifier in the main module"
}
]
},
"errors": {}
},
"filePaths": [
"function-declarations.go"
],
"patch": [
"diff --git a/function-declarations.go b/function-declarations.go",
"index 2a1e7b8..10d0b49 100644",
"--- a/function-declarations.go",
"+++ b/function-declarations.go",
"@@ -1,8 +1,8 @@",
" package main",
" ",
" func main() {",
"-func f1() {}",
"-func f2(a int, b, c, d string) int {}",
"-func f2() (int, error) {}",
"-func f2() (result int, err error) {}",
"+func fa() {}",
"+func fb(a int, b, c, d string) int {}",
"+func fc() (int, error) {}",
"+func fd() (result int, err error) {}",
" }"
],
"gitDir": "test/corpus/repos/go",
"shas": "d22e3d1c200a31f80f84a10c1179f07fcdb1338a..66594d797cd042296aa4acfabb49a5d0df4b8c7f"
}
,{
"testCaseDescription": "go-function-declarations-delete-replacement-test",
"expectedResult": {
"changes": {
"function-declarations.go": [
{
"span": {
"replace": [
{
"start": [
4,
6
],
"end": [
4,
8
]
},
{
"start": [
4,
6
],
"end": [
4,
8
]
}
]
},
"summary": "Replaced the 'fa' identifier with the 'f1' identifier in the f1() function call of the 'main' function"
},
{
"span": {
"replace": [
{
"start": [
5,
6
],
"end": [
5,
8
]
},
{
"start": [
5,
6
],
"end": [
5,
8
]
}
]
},
"summary": "Replaced the 'fb' identifier with the 'f2' identifier in the main module"
},
{
"span": {
"replace": [
{
"start": [
6,
6
],
"end": [
6,
8
]
},
{
"start": [
6,
6
],
"end": [
6,
8
]
}
]
},
"summary": "Replaced the 'fc' identifier with the 'f2' identifier in the main module"
},
{
"span": {
"replace": [
{
"start": [
7,
6
],
"end": [
7,
8
]
},
{
"start": [
7,
6
],
"end": [
7,
8
]
}
]
},
"summary": "Replaced the 'fd' identifier with the 'f2' identifier in the main module"
}
]
},
"errors": {}
},
"filePaths": [
"function-declarations.go"
],
"patch": [
"diff --git a/function-declarations.go b/function-declarations.go",
"index 10d0b49..2a1e7b8 100644",
"--- a/function-declarations.go",
"+++ b/function-declarations.go",
"@@ -1,8 +1,8 @@",
" package main",
" ",
" func main() {",
"-func fa() {}",
"-func fb(a int, b, c, d string) int {}",
"-func fc() (int, error) {}",
"-func fd() (result int, err error) {}",
"+func f1() {}",
"+func f2(a int, b, c, d string) int {}",
"+func f2() (int, error) {}",
"+func f2() (result int, err error) {}",
" }"
],
"gitDir": "test/corpus/repos/go",
"shas": "66594d797cd042296aa4acfabb49a5d0df4b8c7f..8c91c066e0960e41d9f69b552f4d0d789368a9f9"
}
,{
"testCaseDescription": "go-function-declarations-delete-insert-test",
"expectedResult": {
"changes": {
"function-declarations.go": [
{
"span": {
"replace": [
{
"start": [
1,
1
],
"end": [
8,
1
]
},
{
"start": [
1,
1
],
"end": [
6,
1
]
}
]
},
"summary": "Replaced the 'main' module with the 'main' module"
}
]
},
"errors": {}
},
"filePaths": [
"function-declarations.go"
],
"patch": [
"diff --git a/function-declarations.go b/function-declarations.go",
"index 2a1e7b8..7905807 100644",
"--- a/function-declarations.go",
"+++ b/function-declarations.go",
"@@ -1,8 +1,5 @@",
" package main",
" ",
" func main() {",
"-func f1() {}",
"-func f2(a int, b, c, d string) int {}",
"-func f2() (int, error) {}",
"-func f2() (result int, err error) {}",
"+",
" }"
],
"gitDir": "test/corpus/repos/go",
"shas": "8c91c066e0960e41d9f69b552f4d0d789368a9f9..56b47e3c7d7ab1229f2ff8f83465820c691449b6"
}
,{
"testCaseDescription": "go-function-declarations-teardown-test",
"expectedResult": {
"changes": {
"function-declarations.go": [
{
"span": {
"delete": {
"start": [
1,
1
],
"end": [
6,
1
]
}
},
"summary": "Deleted the 'main' module"
}
]
},
"errors": {}
},
"filePaths": [
"function-declarations.go"
],
"patch": [
"diff --git a/function-declarations.go b/function-declarations.go",
"index 7905807..e69de29 100644",
"--- a/function-declarations.go",
"+++ b/function-declarations.go",
"@@ -1,5 +0,0 @@",
"-package main",
"-",
"-func main() {",
"-",
"-}"
],
"gitDir": "test/corpus/repos/go",
"shas": "56b47e3c7d7ab1229f2ff8f83465820c691449b6..3b975fed0b66d037c50f3b21d664f68301f0c901"
}]