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-02-06 10:44:04 -05:00

515 lines
17 KiB
JSON

[{
"testCaseDescription": "go-function-declarations-setup-test",
"expectedResult": {
"changes": {
"function-declarations.go": [
{
"span": {
"insert": {
"start": [
1,
1
],
"end": [
1,
13
]
}
},
"summary": "Added the 'main' module"
},
{
"span": {
"insert": {
"start": [
3,
1
],
"end": [
5,
2
]
}
},
"summary": "Added the 'main' function"
}
]
},
"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": "c6f67bb8cd7d913aef92b7064167389be8aba005..31b25d7f0916847e14a275928dfe547ecfe5f8b2"
}
,{
"testCaseDescription": "go-function-declarations-insert-test",
"expectedResult": {
"changes": {
"function-declarations.go": [
{
"span": {
"replace": [
{
"start": [
1,
1
],
"end": [
1,
13
]
},
{
"start": [
1,
1
],
"end": [
9,
1
]
}
]
},
"summary": "Replaced the 'main' module with 'package main\n\nfunc main() {\nfunc f1() {}\nfunc f2(a int, b, c, d string) int {}\nfunc f2() (int, error) {}\nfunc f2() (result int, err error) {}\n}\n' at line 1, column 1 - line 9, column 1"
}
]
},
"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": "31b25d7f0916847e14a275928dfe547ecfe5f8b2..cec2b6e42b2004d94cff3f4bb3e4fb865c3802c5"
}
,{
"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 fb function"
},
{
"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 fc function"
},
{
"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 fd function"
}
]
},
"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": "cec2b6e42b2004d94cff3f4bb3e4fb865c3802c5..8b6a0102815a843f15f22cb1decfb2475cce12f7"
}
,{
"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 f2 function"
},
{
"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 f2 function"
},
{
"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 f2 function"
}
]
},
"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": "8b6a0102815a843f15f22cb1decfb2475cce12f7..b4ca15a5b0135979388101b65bcd51e392704815"
}
,{
"testCaseDescription": "go-function-declarations-delete-insert-test",
"expectedResult": {
"changes": {
"function-declarations.go": [
{
"span": {
"replace": [
{
"start": [
1,
1
],
"end": [
9,
1
]
},
{
"start": [
1,
1
],
"end": [
1,
13
]
}
]
},
"summary": "Replaced 'package main\n\nfunc main() {\nfunc f1() {}\nfunc f2(a int, b, c, d string) int {}\nfunc f2() (int, error) {}\nfunc f2() (result int, err error) {}\n}\n' at line 1, column 1 - line 9, column 1 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": "b4ca15a5b0135979388101b65bcd51e392704815..2986b4c0c04f9583d0c901ee2e4218d7f2a3f7ec"
}
,{
"testCaseDescription": "go-function-declarations-teardown-test",
"expectedResult": {
"changes": {
"function-declarations.go": [
{
"span": {
"delete": {
"start": [
1,
1
],
"end": [
1,
13
]
}
},
"summary": "Deleted the 'main' module"
},
{
"span": {
"delete": {
"start": [
3,
1
],
"end": [
5,
2
]
}
},
"summary": "Deleted the 'main' function"
}
]
},
"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": "2986b4c0c04f9583d0c901ee2e4218d7f2a3f7ec..47904bad825de948224fb80e0c17cd04f54a0411"
}]