1
1
mirror of https://github.com/github/semantic.git synced 2024-12-23 23:11:50 +03:00
semantic/test/corpus/diff-summaries/go/function-declarations.json

485 lines
16 KiB
JSON
Raw Normal View History

2016-11-02 17:50:05 +03:00
[{
2016-12-02 00:03:52 +03:00
"testCaseDescription": "go-function-declarations-setup-test",
2016-11-02 17:50:05 +03:00
"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-12-02 00:03:52 +03:00
6,
1
2016-11-02 17:50:05 +03:00
]
}
},
2016-12-02 00:03:52 +03:00
"summary": "Added the 'main' module"
}
]
2016-12-02 00:03:52 +03:00
},
"errors": {}
},
"filePaths": [
"function-declarations.go"
],
"patch": [
"diff --git a/function-declarations.go b/function-declarations.go",
2016-12-02 00:03:52 +03:00
"index e69de29..7905807 100644",
"--- a/function-declarations.go",
"+++ b/function-declarations.go",
2016-12-02 00:03:52 +03:00
"@@ -0,0 +1,5 @@",
"+package main",
"+",
"+func main() {",
"+",
"+}"
],
"gitDir": "test/corpus/repos/go",
2017-01-10 01:21:36 +03:00
"shas": "b8eec1c43890f6532de99f06759f8b4aed674953..658fb1404ea2e5236bc9d154f281e77f1ac48dd8"
}
,{
2016-12-02 00:03:52 +03:00
"testCaseDescription": "go-function-declarations-insert-test",
"expectedResult": {
"changes": {
"function-declarations.go": [
2016-11-02 17:50:05 +03:00
{
"span": {
2016-12-02 00:03:52 +03:00
"replace": [
{
"start": [
1,
1
],
"end": [
6,
1
]
},
{
"start": [
1,
1
],
"end": [
8,
1
]
}
]
2016-11-02 17:50:05 +03:00
},
2016-12-02 00:03:52 +03:00
"summary": "Replaced the 'main' module with the 'main' module"
}
]
},
2016-12-02 00:03:52 +03:00
"errors": {}
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",
2016-12-02 00:03:52 +03:00
"index 7905807..2a1e7b8 100644",
2016-11-11 00:19:53 +03:00
"--- a/function-declarations.go",
"+++ b/function-declarations.go",
2016-12-02 00:03:52 +03:00
"@@ -1,5 +1,8 @@",
" package main",
" ",
" func main() {",
"-",
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) {}",
2016-12-02 00:03:52 +03:00
" }"
2016-11-11 00:19:53 +03:00
],
2016-11-02 17:50:05 +03:00
"gitDir": "test/corpus/repos/go",
2017-01-10 01:21:36 +03:00
"shas": "658fb1404ea2e5236bc9d154f281e77f1ac48dd8..d4f810691ebcafcda627ebd1623b08b76c2446dc"
2016-11-02 17:50:05 +03:00
}
,{
2016-12-02 00:03:52 +03:00
"testCaseDescription": "go-function-declarations-replacement-test",
2016-11-02 17:50:05 +03:00
"expectedResult": {
"changes": {
"function-declarations.go": [
{
"span": {
"replace": [
{
"start": [
2016-12-02 00:03:52 +03:00
4,
6
],
"end": [
2016-12-02 00:03:52 +03:00
4,
8
]
},
{
"start": [
2016-12-02 00:03:52 +03:00
4,
6
],
"end": [
2016-12-02 00:03:52 +03:00
4,
8
]
}
]
2016-11-02 17:50:05 +03:00
},
2016-12-02 00:03:52 +03:00
"summary": "Replaced the 'f1' identifier with the 'fa' identifier in the fa() function call of the 'main' function"
2016-11-02 17:50:05 +03:00
},
{
"span": {
"replace": [
{
"start": [
2016-12-02 00:03:52 +03:00
5,
6
],
"end": [
2016-12-02 00:03:52 +03:00
5,
8
]
},
{
"start": [
2016-12-02 00:03:52 +03:00
5,
6
],
"end": [
2016-12-02 00:03:52 +03:00
5,
8
]
}
]
2016-11-02 17:50:05 +03:00
},
2016-12-02 00:03:52 +03:00
"summary": "Replaced the 'f2' identifier with the 'fb' identifier in the main module"
2016-11-02 17:50:05 +03:00
},
{
"span": {
"replace": [
{
"start": [
2016-12-02 00:03:52 +03:00
6,
6
],
"end": [
2016-12-02 00:03:52 +03:00
6,
8
]
},
{
"start": [
2016-12-02 00:03:52 +03:00
6,
6
],
"end": [
2016-12-02 00:03:52 +03:00
6,
8
]
}
]
2016-11-02 17:50:05 +03:00
},
2016-12-02 00:03:52 +03:00
"summary": "Replaced the 'f2' identifier with the 'fc' identifier in the main module"
2016-11-02 17:50:05 +03:00
},
{
"span": {
"replace": [
{
"start": [
2016-12-02 00:03:52 +03:00
7,
6
],
"end": [
2016-12-02 00:03:52 +03:00
7,
8
]
},
{
"start": [
2016-12-02 00:03:52 +03:00
7,
6
],
"end": [
2016-12-02 00:03:52 +03:00
7,
8
]
}
]
2016-11-02 17:50:05 +03:00
},
2016-12-02 00:03:52 +03:00
"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",
2016-12-02 00:03:52 +03:00
"index 2a1e7b8..10d0b49 100644",
"--- a/function-declarations.go",
"+++ b/function-declarations.go",
2016-12-02 00:03:52 +03:00
"@@ -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",
2017-01-10 01:21:36 +03:00
"shas": "d4f810691ebcafcda627ebd1623b08b76c2446dc..4cccda73273a4c00dd7aafe072237b76075b68bc"
}
,{
2016-12-02 00:03:52 +03:00
"testCaseDescription": "go-function-declarations-delete-replacement-test",
"expectedResult": {
"changes": {
"function-declarations.go": [
2016-11-02 17:50:05 +03:00
{
"span": {
"replace": [
{
"start": [
2016-12-02 00:03:52 +03:00
4,
6
],
"end": [
2016-12-02 00:03:52 +03:00
4,
8
]
},
{
"start": [
2016-12-02 00:03:52 +03:00
4,
6
],
"end": [
2016-12-02 00:03:52 +03:00
4,
8
]
}
]
2016-11-02 17:50:05 +03:00
},
2016-12-02 00:03:52 +03:00
"summary": "Replaced the 'fa' identifier with the 'f1' identifier in the f1() function call of the 'main' function"
2016-11-02 17:50:05 +03:00
},
{
"span": {
"replace": [
{
"start": [
2016-12-02 00:03:52 +03:00
5,
6
],
"end": [
2016-12-02 00:03:52 +03:00
5,
8
]
},
{
"start": [
2016-12-02 00:03:52 +03:00
5,
6
],
"end": [
2016-12-02 00:03:52 +03:00
5,
8
]
}
]
2016-11-02 17:50:05 +03:00
},
2016-12-02 00:03:52 +03:00
"summary": "Replaced the 'fb' identifier with the 'f2' identifier in the main module"
2016-11-02 17:50:05 +03:00
},
{
"span": {
"replace": [
{
"start": [
2016-12-02 00:03:52 +03:00
6,
6
],
"end": [
2016-12-02 00:03:52 +03:00
6,
8
]
},
{
"start": [
2016-12-02 00:03:52 +03:00
6,
6
],
"end": [
2016-12-02 00:03:52 +03:00
6,
8
]
}
]
2016-11-02 17:50:05 +03:00
},
2016-12-02 00:03:52 +03:00
"summary": "Replaced the 'fc' identifier with the 'f2' identifier in the main module"
},
{
"span": {
"replace": [
{
"start": [
2016-12-02 00:03:52 +03:00
7,
6
],
"end": [
2016-12-02 00:03:52 +03:00
7,
8
]
},
{
"start": [
2016-12-02 00:03:52 +03:00
7,
6
],
"end": [
2016-12-02 00:03:52 +03:00
7,
8
]
}
]
2016-11-02 17:50:05 +03:00
},
2016-12-02 00:03:52 +03:00
"summary": "Replaced the 'fd' identifier with the 'f2' identifier in the main module"
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",
2016-12-02 00:03:52 +03:00
"index 10d0b49..2a1e7b8 100644",
"--- a/function-declarations.go",
"+++ b/function-declarations.go",
2016-12-02 00:03:52 +03:00
"@@ -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) {}",
2016-12-02 00:03:52 +03:00
"+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",
2017-01-10 01:21:36 +03:00
"shas": "4cccda73273a4c00dd7aafe072237b76075b68bc..88897f4733e4c96c27b8fff5922dc084b6cf2a17"
}
,{
2016-12-02 00:03:52 +03:00
"testCaseDescription": "go-function-declarations-delete-insert-test",
"expectedResult": {
"changes": {
"function-declarations.go": [
2016-11-02 17:50:05 +03:00
{
"span": {
2016-12-02 00:03:52 +03:00
"replace": [
{
"start": [
1,
1
],
"end": [
8,
1
]
},
{
"start": [
1,
1
],
"end": [
6,
1
]
}
]
2016-11-02 17:50:05 +03:00
},
2016-12-02 00:03:52 +03:00
"summary": "Replaced the 'main' module with the 'main' module"
}
]
},
2016-12-02 00:03:52 +03:00
"errors": {}
},
"filePaths": [
"function-declarations.go"
],
"patch": [
"diff --git a/function-declarations.go b/function-declarations.go",
2016-12-02 00:03:52 +03:00
"index 2a1e7b8..7905807 100644",
"--- a/function-declarations.go",
"+++ b/function-declarations.go",
2016-12-02 00:03:52 +03:00
"@@ -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) {}",
2016-12-02 00:03:52 +03:00
"+",
" }"
],
"gitDir": "test/corpus/repos/go",
2017-01-10 01:21:36 +03:00
"shas": "88897f4733e4c96c27b8fff5922dc084b6cf2a17..d205f130b678dc60fc2f6346a2f348c69707e284"
}
,{
2016-12-02 00:03:52 +03:00
"testCaseDescription": "go-function-declarations-teardown-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": [
2016-12-02 00:03:52 +03:00
6,
1
2016-11-02 17:50:05 +03:00
]
}
},
2016-12-02 00:03:52 +03:00
"summary": "Deleted the 'main' module"
2016-11-02 17:50:05 +03:00
}
]
2016-12-02 00:03:52 +03:00
},
"errors": {}
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",
2016-12-02 00:03:52 +03:00
"index 7905807..e69de29 100644",
2016-11-11 00:19:53 +03:00
"--- a/function-declarations.go",
"+++ b/function-declarations.go",
2016-12-02 00:03:52 +03:00
"@@ -1,5 +0,0 @@",
"-package main",
"-",
"-func main() {",
"-",
"-}"
2016-11-11 00:19:53 +03:00
],
2016-11-02 17:50:05 +03:00
"gitDir": "test/corpus/repos/go",
2017-01-10 01:21:36 +03:00
"shas": "d205f130b678dc60fc2f6346a2f348c69707e284..92413f0e5c4c26958418b88010b1bfc6603c9308"
2016-11-02 17:50:05 +03:00
}]