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

930 lines
32 KiB
JSON
Raw Normal View History

2016-11-02 17:50:05 +03:00
[{
"testCaseDescription": "go-function-declarations-insert-test",
"expectedResult": {
"changes": {
"function-declarations.go": [
{
"span": {
"insert": {
"start": [
2016-11-11 00:19:53 +03:00
1,
2016-11-02 17:50:05 +03:00
1
],
"end": [
2016-11-11 00:19:53 +03:00
1,
2016-11-02 17:50:05 +03:00
13
]
}
},
"summary": "Added the 'f1' function"
}
]
},
"errors": {
"function-declarations.go": [
2016-11-02 17:50:05 +03:00
{
"span": {
"insert": {
"start": [
2016-11-11 00:19:53 +03:00
2,
1
2016-11-02 17:50:05 +03:00
],
"end": [
2016-11-11 00:19:53 +03:00
2,
38
2016-11-02 17:50:05 +03:00
]
}
},
"summary": "Added the 'func f2(a int, b, c, d string) int {}' at line 2, column 1 - line 2, column 38"
2016-11-02 17:50:05 +03:00
},
{
"span": {
"insert": {
"start": [
3,
1
2016-11-02 17:50:05 +03:00
],
"end": [
3,
26
2016-11-02 17:50:05 +03:00
]
}
},
"summary": "Added the 'func f2() (int, error) {}' at line 3, column 1 - line 3, column 26"
2016-11-02 17:50:05 +03:00
},
{
"span": {
"insert": {
"start": [
4,
1
2016-11-02 17:50:05 +03:00
],
"end": [
4,
37
2016-11-02 17:50:05 +03:00
]
}
},
"summary": "Added the 'func f2() (result int, err error) {}' at line 4, column 1 - line 4, column 37"
}
]
}
},
"filePaths": [
"function-declarations.go"
],
"patch": [
"diff --git a/function-declarations.go b/function-declarations.go",
"index e69de29..21da2ea 100644",
"--- a/function-declarations.go",
"+++ b/function-declarations.go",
"@@ -0,0 +1,4 @@",
"+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": "1cfc4770f33afe51641b5c1ed9683984d1ac4ae5..b8ea4fd0800ac92d14585218798b6958a31c0fc7"
}
,{
"testCaseDescription": "go-function-declarations-replacement-insert-test",
"expectedResult": {
"changes": {
"function-declarations.go": [
2016-11-02 17:50:05 +03:00
{
"span": {
"insert": {
"start": [
1,
1
2016-11-02 17:50:05 +03:00
],
"end": [
1,
13
2016-11-02 17:50:05 +03:00
]
}
},
"summary": "Added the 'fa' function"
2016-11-02 17:50:05 +03:00
},
{
"span": {
"insert": {
"start": [
5,
1
2016-11-02 17:50:05 +03:00
],
"end": [
5,
13
2016-11-02 17:50:05 +03:00
]
}
},
"summary": "Added the 'f1' function"
}
]
},
"errors": {
"function-declarations.go": [
2016-11-02 17:50:05 +03:00
{
"span": {
"insert": {
"start": [
2016-11-11 00:19:53 +03:00
2,
1
2016-11-02 17:50:05 +03:00
],
"end": [
2016-11-11 00:19:53 +03:00
2,
2016-11-02 17:50:05 +03:00
38
]
}
},
"summary": "Added the 'func fb(a int, b, c, d string) int {}' at line 2, column 1 - line 2, column 38"
2016-11-02 17:50:05 +03:00
},
{
"span": {
"insert": {
"start": [
2016-11-11 00:19:53 +03:00
3,
1
2016-11-02 17:50:05 +03:00
],
"end": [
2016-11-11 00:19:53 +03:00
3,
2016-11-02 17:50:05 +03:00
26
]
}
},
"summary": "Added the 'func fc() (int, error) {}' at line 3, column 1 - line 3, column 26"
2016-11-02 17:50:05 +03:00
},
{
"span": {
"insert": {
"start": [
2016-11-11 00:19:53 +03:00
4,
1
2016-11-02 17:50:05 +03:00
],
"end": [
2016-11-11 00:19:53 +03:00
4,
37
2016-11-02 17:50:05 +03:00
]
}
},
"summary": "Added the 'func fd() (result int, err error) {}' at line 4, column 1 - line 4, column 37"
2016-11-02 17:50:05 +03:00
},
{
"span": {
"insert": {
"start": [
6,
1
2016-11-02 17:50:05 +03:00
],
"end": [
6,
38
2016-11-02 17:50:05 +03:00
]
}
},
"summary": "Added the 'func f2(a int, b, c, d string) int {}' at line 6, column 1 - line 6, column 38"
2016-11-02 17:50:05 +03:00
},
{
"span": {
"insert": {
"start": [
7,
1
2016-11-02 17:50:05 +03:00
],
"end": [
7,
26
2016-11-02 17:50:05 +03:00
]
}
},
"summary": "Added the 'func f2() (int, error) {}' at line 7, column 1 - line 7, column 26"
2016-11-02 17:50:05 +03:00
},
{
"span": {
"insert": {
"start": [
8,
1
2016-11-02 17:50:05 +03:00
],
"end": [
8,
2016-11-02 17:50:05 +03:00
37
]
}
},
"summary": "Added the 'func f2() (result int, err error) {}' at line 8, column 1 - line 8, column 37"
2016-11-02 17:50:05 +03:00
}
]
}
2016-11-02 17:50:05 +03:00
},
"filePaths": [
"function-declarations.go"
],
2016-11-11 00:19:53 +03:00
"patch": [
"diff --git a/function-declarations.go b/function-declarations.go",
"index 21da2ea..768679a 100644",
2016-11-11 00:19:53 +03:00
"--- a/function-declarations.go",
"+++ b/function-declarations.go",
"@@ -1,3 +1,11 @@",
"+func fa() {}",
"+func fb(a int, b, c, d string) int {}",
"+func fc() (int, error) {}",
"+func fd() (result int, err error) {}",
2016-11-11 00:19:53 +03:00
"+func f1() {}",
"+func f2(a int, b, c, d string) int {}",
"+func f2() (int, error) {}",
"+func f2() (result int, err error) {}",
" func f1() {}",
" func f2(a int, b, c, d string) int {}",
" func f2() (int, error) {}"
2016-11-11 00:19:53 +03:00
],
2016-11-02 17:50:05 +03:00
"gitDir": "test/corpus/repos/go",
"shas": "b8ea4fd0800ac92d14585218798b6958a31c0fc7..fcf6ccf0f476627c8abc746a558adb081ed9d7fa"
2016-11-02 17:50:05 +03:00
}
,{
"testCaseDescription": "go-function-declarations-delete-insert-test",
2016-11-02 17:50:05 +03:00
"expectedResult": {
"changes": {
"function-declarations.go": [
{
"span": {
"replace": [
{
"start": [
1,
6
],
"end": [
1,
8
]
},
{
"start": [
1,
6
],
"end": [
1,
8
]
}
]
2016-11-02 17:50:05 +03:00
},
"summary": "Replaced the 'fa' identifier with the 'f1' identifier in the f1 function"
2016-11-02 17:50:05 +03:00
},
{
"span": {
"replace": [
{
"start": [
2,
6
],
"end": [
2,
8
]
},
{
"start": [
2,
6
],
"end": [
2,
8
]
}
]
2016-11-02 17:50:05 +03:00
},
"summary": "Replaced the 'fb' identifier with the 'f2' identifier"
2016-11-02 17:50:05 +03:00
},
{
"span": {
"replace": [
{
"start": [
3,
6
],
"end": [
3,
8
]
},
{
"start": [
3,
6
],
"end": [
3,
8
]
}
]
2016-11-02 17:50:05 +03:00
},
"summary": "Replaced the 'fc' identifier with the 'f2' identifier"
2016-11-02 17:50:05 +03:00
},
{
"span": {
"replace": [
{
"start": [
4,
6
],
"end": [
4,
8
]
},
{
"start": [
4,
6
],
"end": [
4,
8
]
}
]
2016-11-02 17:50:05 +03:00
},
"summary": "Replaced the 'fd' identifier with the 'f2' identifier"
}
]
},
"errors": {}
},
"filePaths": [
"function-declarations.go"
],
"patch": [
"diff --git a/function-declarations.go b/function-declarations.go",
"index 768679a..da899b5 100644",
"--- a/function-declarations.go",
"+++ b/function-declarations.go",
"@@ -1,7 +1,7 @@",
"-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) {}",
" func f1() {}",
" func f2(a int, b, c, d string) int {}",
" func f2() (int, error) {}"
],
"gitDir": "test/corpus/repos/go",
"shas": "fcf6ccf0f476627c8abc746a558adb081ed9d7fa..94fb4817ecc9299b9e1dd90ac05f48c53f5f984a"
}
,{
"testCaseDescription": "go-function-declarations-replacement-test",
"expectedResult": {
"changes": {
"function-declarations.go": [
2016-11-02 17:50:05 +03:00
{
"span": {
"replace": [
{
"start": [
1,
6
],
"end": [
1,
8
]
},
{
"start": [
1,
6
],
"end": [
1,
8
]
}
]
2016-11-02 17:50:05 +03:00
},
"summary": "Replaced the 'f1' identifier with the 'fa' identifier in the fa function"
2016-11-02 17:50:05 +03:00
},
{
"span": {
"replace": [
{
"start": [
2,
6
],
"end": [
2,
8
]
},
{
"start": [
2,
6
],
"end": [
2,
8
]
}
]
2016-11-02 17:50:05 +03:00
},
"summary": "Replaced the 'f2' identifier with the 'fb' identifier"
2016-11-02 17:50:05 +03:00
},
{
"span": {
"replace": [
{
"start": [
3,
6
],
"end": [
3,
8
]
},
{
"start": [
3,
6
],
"end": [
3,
8
]
}
]
2016-11-02 17:50:05 +03:00
},
"summary": "Replaced the 'f2' identifier with the 'fc' identifier"
},
{
"span": {
"replace": [
{
"start": [
4,
6
],
"end": [
4,
8
]
},
{
"start": [
4,
6
],
"end": [
4,
8
]
}
]
2016-11-02 17:50:05 +03:00
},
"summary": "Replaced the 'f2' identifier with the 'fd' identifier"
2016-11-02 17:50:05 +03:00
}
]
},
"errors": {}
},
"filePaths": [
"function-declarations.go"
],
2016-11-11 00:19:53 +03:00
"patch": [
"diff --git a/function-declarations.go b/function-declarations.go",
"index da899b5..768679a 100644",
2016-11-11 00:19:53 +03:00
"--- a/function-declarations.go",
"+++ b/function-declarations.go",
"@@ -1,7 +1,7 @@",
2016-11-11 00:19:53 +03:00
"-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) {}",
" func f1() {}",
" func f2(a int, b, c, d string) int {}",
" func f2() (int, error) {}"
2016-11-11 00:19:53 +03:00
],
2016-11-02 17:50:05 +03:00
"gitDir": "test/corpus/repos/go",
"shas": "94fb4817ecc9299b9e1dd90ac05f48c53f5f984a..b60b66e9fa94b50e4756d060078a0804547be3d9"
2016-11-02 17:50:05 +03:00
}
,{
"testCaseDescription": "go-function-declarations-delete-replacement-test",
2016-11-02 17:50:05 +03:00
"expectedResult": {
"changes": {
"function-declarations.go": [
{
"span": {
"delete": {
"start": [
2016-11-11 00:19:53 +03:00
1,
2016-11-02 17:50:05 +03:00
1
],
"end": [
2016-11-11 00:19:53 +03:00
1,
2016-11-02 17:50:05 +03:00
13
]
}
},
"summary": "Deleted the 'fa' function"
},
{
"span": {
"delete": {
"start": [
5,
1
2016-11-02 17:50:05 +03:00
],
"end": [
5,
13
2016-11-02 17:50:05 +03:00
]
}
},
"summary": "Deleted the 'f1' function"
2016-11-02 17:50:05 +03:00
},
{
"span": {
"insert": {
2016-11-02 17:50:05 +03:00
"start": [
5,
1
2016-11-02 17:50:05 +03:00
],
"end": [
5,
13
2016-11-02 17:50:05 +03:00
]
}
},
"summary": "Added the 'fa' function"
}
]
},
"errors": {
"function-declarations.go": [
2016-11-02 17:50:05 +03:00
{
"span": {
"delete": {
"start": [
2016-11-11 00:19:53 +03:00
2,
1
2016-11-02 17:50:05 +03:00
],
"end": [
2016-11-11 00:19:53 +03:00
2,
38
2016-11-02 17:50:05 +03:00
]
}
},
"summary": "Deleted the 'func fb(a int, b, c, d string) int {}' at line 2, column 1 - line 2, column 38"
2016-11-02 17:50:05 +03:00
},
{
"span": {
"delete": {
"start": [
3,
1
2016-11-02 17:50:05 +03:00
],
"end": [
3,
26
2016-11-02 17:50:05 +03:00
]
}
},
"summary": "Deleted the 'func fc() (int, error) {}' at line 3, column 1 - line 3, column 26"
2016-11-02 17:50:05 +03:00
},
{
"span": {
"delete": {
"start": [
4,
1
2016-11-02 17:50:05 +03:00
],
"end": [
4,
37
2016-11-02 17:50:05 +03:00
]
}
},
"summary": "Deleted the 'func fd() (result int, err error) {}' at line 4, column 1 - line 4, column 37"
2016-11-02 17:50:05 +03:00
},
{
"span": {
"delete": {
"start": [
6,
1
2016-11-02 17:50:05 +03:00
],
"end": [
6,
38
2016-11-02 17:50:05 +03:00
]
}
},
"summary": "Deleted the 'func f2(a int, b, c, d string) int {}' at line 6, column 1 - line 6, column 38"
2016-11-02 17:50:05 +03:00
},
{
"span": {
"delete": {
"start": [
7,
1
2016-11-02 17:50:05 +03:00
],
"end": [
7,
26
2016-11-02 17:50:05 +03:00
]
}
},
"summary": "Deleted the 'func f2() (int, error) {}' at line 7, column 1 - line 7, column 26"
2016-11-02 17:50:05 +03:00
},
{
"span": {
"delete": {
"start": [
8,
1
2016-11-02 17:50:05 +03:00
],
"end": [
8,
37
2016-11-02 17:50:05 +03:00
]
}
},
"summary": "Deleted the 'func f2() (result int, err error) {}' at line 8, column 1 - line 8, column 37"
2016-11-02 17:50:05 +03:00
},
{
"span": {
"insert": {
2016-11-02 17:50:05 +03:00
"start": [
6,
1
2016-11-02 17:50:05 +03:00
],
"end": [
6,
2016-11-02 17:50:05 +03:00
38
]
}
},
"summary": "Added the 'func fb(a int, b, c, d string) int {}' at line 6, column 1 - line 6, column 38"
2016-11-02 17:50:05 +03:00
},
{
"span": {
"insert": {
2016-11-02 17:50:05 +03:00
"start": [
7,
1
2016-11-02 17:50:05 +03:00
],
"end": [
7,
26
2016-11-02 17:50:05 +03:00
]
}
},
"summary": "Added the 'func fc() (int, error) {}' at line 7, column 1 - line 7, column 26"
2016-11-02 17:50:05 +03:00
},
{
"span": {
"insert": {
2016-11-02 17:50:05 +03:00
"start": [
8,
1
2016-11-02 17:50:05 +03:00
],
"end": [
8,
37
2016-11-02 17:50:05 +03:00
]
}
},
"summary": "Added the 'func fd() (result int, err error) {}' at line 8, column 1 - line 8, column 37"
}
]
}
},
"filePaths": [
"function-declarations.go"
],
"patch": [
"diff --git a/function-declarations.go b/function-declarations.go",
"index 768679a..306f918 100644",
"--- a/function-declarations.go",
"+++ b/function-declarations.go",
"@@ -1,12 +1,8 @@",
"-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) {}",
" 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": "b60b66e9fa94b50e4756d060078a0804547be3d9..9677cee90e50ac019d16f74a7499da0d81896c91"
}
,{
"testCaseDescription": "go-function-declarations-delete-test",
"expectedResult": {
"changes": {
"function-declarations.go": [
2016-11-02 17:50:05 +03:00
{
"span": {
"delete": {
"start": [
1,
1
2016-11-02 17:50:05 +03:00
],
"end": [
1,
13
2016-11-02 17:50:05 +03:00
]
}
},
"summary": "Deleted the 'f1' function"
}
]
},
"errors": {
"function-declarations.go": [
2016-11-02 17:50:05 +03:00
{
"span": {
"delete": {
"start": [
2,
1
2016-11-02 17:50:05 +03:00
],
"end": [
2,
38
2016-11-02 17:50:05 +03:00
]
}
},
"summary": "Deleted the 'func f2(a int, b, c, d string) int {}' at line 2, column 1 - line 2, column 38"
2016-11-02 17:50:05 +03:00
},
{
"span": {
"delete": {
"start": [
2016-11-11 00:19:53 +03:00
3,
1
2016-11-02 17:50:05 +03:00
],
"end": [
2016-11-11 00:19:53 +03:00
3,
2016-11-02 17:50:05 +03:00
26
]
}
},
"summary": "Deleted the 'func f2() (int, error) {}' at line 3, column 1 - line 3, column 26"
2016-11-02 17:50:05 +03:00
},
{
"span": {
"delete": {
"start": [
2016-11-11 00:19:53 +03:00
4,
1
2016-11-02 17:50:05 +03:00
],
"end": [
2016-11-11 00:19:53 +03:00
4,
37
2016-11-02 17:50:05 +03:00
]
}
},
"summary": "Deleted the 'func f2() (result int, err error) {}' at line 4, column 1 - line 4, column 37"
}
]
}
},
"filePaths": [
"function-declarations.go"
],
"patch": [
"diff --git a/function-declarations.go b/function-declarations.go",
"index 306f918..cc84bb3 100644",
"--- a/function-declarations.go",
"+++ b/function-declarations.go",
"@@ -1,7 +1,3 @@",
"-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) {}"
],
"gitDir": "test/corpus/repos/go",
"shas": "9677cee90e50ac019d16f74a7499da0d81896c91..3847a6a7099687b768bdfc04aad517f2df75bf47"
}
,{
"testCaseDescription": "go-function-declarations-delete-rest-test",
"expectedResult": {
"changes": {
"function-declarations.go": [
2016-11-02 17:50:05 +03:00
{
"span": {
"delete": {
"start": [
1,
1
2016-11-02 17:50:05 +03:00
],
"end": [
1,
13
2016-11-02 17:50:05 +03:00
]
}
},
"summary": "Deleted the 'fa' function"
}
]
},
"errors": {
"function-declarations.go": [
2016-11-02 17:50:05 +03:00
{
"span": {
"delete": {
"start": [
2,
1
2016-11-02 17:50:05 +03:00
],
"end": [
2,
38
2016-11-02 17:50:05 +03:00
]
}
},
"summary": "Deleted the 'func fb(a int, b, c, d string) int {}' at line 2, column 1 - line 2, column 38"
2016-11-02 17:50:05 +03:00
},
{
"span": {
"delete": {
"start": [
3,
1
2016-11-02 17:50:05 +03:00
],
"end": [
3,
26
2016-11-02 17:50:05 +03:00
]
}
},
"summary": "Deleted the 'func fc() (int, error) {}' at line 3, column 1 - line 3, column 26"
2016-11-02 17:50:05 +03:00
},
{
"span": {
"delete": {
"start": [
2016-11-11 00:19:53 +03:00
4,
1
2016-11-02 17:50:05 +03:00
],
"end": [
2016-11-11 00:19:53 +03:00
4,
2016-11-02 17:50:05 +03:00
37
]
}
},
"summary": "Deleted the 'func fd() (result int, err error) {}' at line 4, column 1 - line 4, column 37"
2016-11-02 17:50:05 +03:00
}
]
}
2016-11-02 17:50:05 +03:00
},
"filePaths": [
"function-declarations.go"
],
2016-11-11 00:19:53 +03:00
"patch": [
"diff --git a/function-declarations.go b/function-declarations.go",
"index cc84bb3..e69de29 100644",
"--- a/function-declarations.go",
"+++ b/function-declarations.go",
"@@ -1,4 +0,0 @@",
"-func fa() {}",
"-func fb(a int, b, c, d string) int {}",
"-func fc() (int, error) {}",
"-func fd() (result int, err error) {}"
],
2016-11-02 17:50:05 +03:00
"gitDir": "test/corpus/repos/go",
"shas": "3847a6a7099687b768bdfc04aad517f2df75bf47..03191e600093d2810fbd1457b8ce453f3a9696bf"
2016-11-02 17:50:05 +03:00
}]