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/function-declarations.json
2017-01-17 15:26:07 -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 e69de29b..79058077 100644",
"--- a/function-declarations.go",
"+++ b/function-declarations.go",
"@@ -0,0 +1,5 @@",
"+package main",
"+",
"+func main() {",
"+",
"+}"
],
"gitDir": "test/corpus/repos/go",
"shas": "945fb4e6905c2b97bfd8fedd3c016e6f4a8c4fa6..53afff937bb03e5626aefc0b7dfd05db7e167ec5"
}
,{
"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 79058077..2a1e7b86 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": "53afff937bb03e5626aefc0b7dfd05db7e167ec5..fe8b8c06effbee7c8ea48c251ea6db6788ed5f83"
}
,{
"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 2a1e7b86..10d0b496 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": "fe8b8c06effbee7c8ea48c251ea6db6788ed5f83..424c0c02bdf9e5988e55cfa5b980c9d3c2265b5c"
}
,{
"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 10d0b496..2a1e7b86 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": "424c0c02bdf9e5988e55cfa5b980c9d3c2265b5c..cb85a9536cad72b815feeb18731ebbeae8465196"
}
,{
"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 2a1e7b86..79058077 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": "cb85a9536cad72b815feeb18731ebbeae8465196..a6f74271ab157809b28c97eb6da04f69ad8d8814"
}
,{
"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 79058077..e69de29b 100644",
"--- a/function-declarations.go",
"+++ b/function-declarations.go",
"@@ -1,5 +0,0 @@",
"-package main",
"-",
"-func main() {",
"-",
"-}"
],
"gitDir": "test/corpus/repos/go",
"shas": "a6f74271ab157809b28c97eb6da04f69ad8d8814..6db5b98058f6889a0e2a736415bbd346a877a81d"
}]