mirror of
https://github.com/github/semantic.git
synced 2024-12-23 23:11:50 +03:00
728 lines
24 KiB
JSON
728 lines
24 KiB
JSON
[{
|
|
"testCaseDescription": "go-single-line-function-declarations-insert-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"single-line-function-declarations.go": [
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
1,
|
|
18
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'f1' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
2,
|
|
1
|
|
],
|
|
"end": [
|
|
2,
|
|
23
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'f2' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
3,
|
|
1
|
|
],
|
|
"end": [
|
|
3,
|
|
24
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'f3' function"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"single-line-function-declarations.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/single-line-function-declarations.go b/single-line-function-declarations.go",
|
|
"index e69de29..3ac1720 100644",
|
|
"--- a/single-line-function-declarations.go",
|
|
"+++ b/single-line-function-declarations.go",
|
|
"@@ -0,0 +1,3 @@",
|
|
"+func f1() { a() }",
|
|
"+func f2() { a(); b() }",
|
|
"+func f3() { a(); b(); }"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "a8723771e5d63042fcbdb0f159727932e50bf992..9be5cebc2faf878bbd5a399e9fee7cde853cd550"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-single-line-function-declarations-replacement-insert-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"single-line-function-declarations.go": [
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
1,
|
|
18
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'g1' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
2,
|
|
1
|
|
],
|
|
"end": [
|
|
2,
|
|
23
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'g2' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
3,
|
|
1
|
|
],
|
|
"end": [
|
|
3,
|
|
24
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'g3' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
4,
|
|
1
|
|
],
|
|
"end": [
|
|
4,
|
|
18
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'f1' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
5,
|
|
1
|
|
],
|
|
"end": [
|
|
5,
|
|
23
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'f2' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
6,
|
|
1
|
|
],
|
|
"end": [
|
|
6,
|
|
24
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'f3' function"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"single-line-function-declarations.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/single-line-function-declarations.go b/single-line-function-declarations.go",
|
|
"index 3ac1720..39e0696 100644",
|
|
"--- a/single-line-function-declarations.go",
|
|
"+++ b/single-line-function-declarations.go",
|
|
"@@ -1,3 +1,9 @@",
|
|
"+func g1() { a() }",
|
|
"+func g2() { a(); b() }",
|
|
"+func g3() { a(); b(); }",
|
|
"+func f1() { a() }",
|
|
"+func f2() { a(); b() }",
|
|
"+func f3() { a(); b(); }",
|
|
" func f1() { a() }",
|
|
" func f2() { a(); b() }",
|
|
" func f3() { a(); b(); }"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "9be5cebc2faf878bbd5a399e9fee7cde853cd550..23f9d2d89d2b853497b1d76a1ca8989a9e35b810"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-single-line-function-declarations-delete-insert-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"single-line-function-declarations.go": [
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
1,
|
|
6
|
|
],
|
|
"end": [
|
|
1,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
1,
|
|
6
|
|
],
|
|
"end": [
|
|
1,
|
|
8
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'g1' identifier with the 'f1' identifier in the f1 function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
2,
|
|
6
|
|
],
|
|
"end": [
|
|
2,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
2,
|
|
6
|
|
],
|
|
"end": [
|
|
2,
|
|
8
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'g2' identifier with the 'f2' identifier in the f2 function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
3,
|
|
6
|
|
],
|
|
"end": [
|
|
3,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
3,
|
|
6
|
|
],
|
|
"end": [
|
|
3,
|
|
8
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'g3' identifier with the 'f3' identifier in the f3 function"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"single-line-function-declarations.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/single-line-function-declarations.go b/single-line-function-declarations.go",
|
|
"index 39e0696..eec54a8 100644",
|
|
"--- a/single-line-function-declarations.go",
|
|
"+++ b/single-line-function-declarations.go",
|
|
"@@ -1,6 +1,6 @@",
|
|
"-func g1() { a() }",
|
|
"-func g2() { a(); b() }",
|
|
"-func g3() { a(); b(); }",
|
|
"+func f1() { a() }",
|
|
"+func f2() { a(); b() }",
|
|
"+func f3() { a(); b(); }",
|
|
" func f1() { a() }",
|
|
" func f2() { a(); b() }",
|
|
" func f3() { a(); b(); }"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "23f9d2d89d2b853497b1d76a1ca8989a9e35b810..9590203ecfcb471d4c2666eb7bf972261c5c6687"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-single-line-function-declarations-replacement-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"single-line-function-declarations.go": [
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
1,
|
|
6
|
|
],
|
|
"end": [
|
|
1,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
1,
|
|
6
|
|
],
|
|
"end": [
|
|
1,
|
|
8
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'f1' identifier with the 'g1' identifier in the g1 function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
2,
|
|
6
|
|
],
|
|
"end": [
|
|
2,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
2,
|
|
6
|
|
],
|
|
"end": [
|
|
2,
|
|
8
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'f2' identifier with the 'g2' identifier in the g2 function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
3,
|
|
6
|
|
],
|
|
"end": [
|
|
3,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
3,
|
|
6
|
|
],
|
|
"end": [
|
|
3,
|
|
8
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'f3' identifier with the 'g3' identifier in the g3 function"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"single-line-function-declarations.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/single-line-function-declarations.go b/single-line-function-declarations.go",
|
|
"index eec54a8..39e0696 100644",
|
|
"--- a/single-line-function-declarations.go",
|
|
"+++ b/single-line-function-declarations.go",
|
|
"@@ -1,6 +1,6 @@",
|
|
"-func f1() { a() }",
|
|
"-func f2() { a(); b() }",
|
|
"-func f3() { a(); b(); }",
|
|
"+func g1() { a() }",
|
|
"+func g2() { a(); b() }",
|
|
"+func g3() { a(); b(); }",
|
|
" func f1() { a() }",
|
|
" func f2() { a(); b() }",
|
|
" func f3() { a(); b(); }"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "9590203ecfcb471d4c2666eb7bf972261c5c6687..562c32409040414ebae043107d747062d5c5dd7f"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-single-line-function-declarations-delete-replacement-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"single-line-function-declarations.go": [
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
1,
|
|
18
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'g1' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
2,
|
|
1
|
|
],
|
|
"end": [
|
|
2,
|
|
23
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'g2' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
3,
|
|
1
|
|
],
|
|
"end": [
|
|
3,
|
|
24
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'g3' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
4,
|
|
1
|
|
],
|
|
"end": [
|
|
4,
|
|
18
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'f1' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
5,
|
|
1
|
|
],
|
|
"end": [
|
|
5,
|
|
23
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'f2' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
6,
|
|
1
|
|
],
|
|
"end": [
|
|
6,
|
|
24
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'f3' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
4,
|
|
1
|
|
],
|
|
"end": [
|
|
4,
|
|
18
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'g1' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
5,
|
|
1
|
|
],
|
|
"end": [
|
|
5,
|
|
23
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'g2' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
6,
|
|
1
|
|
],
|
|
"end": [
|
|
6,
|
|
24
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'g3' function"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"single-line-function-declarations.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/single-line-function-declarations.go b/single-line-function-declarations.go",
|
|
"index 39e0696..7fcb3a1 100644",
|
|
"--- a/single-line-function-declarations.go",
|
|
"+++ b/single-line-function-declarations.go",
|
|
"@@ -1,9 +1,6 @@",
|
|
"-func g1() { a() }",
|
|
"-func g2() { a(); b() }",
|
|
"-func g3() { a(); b(); }",
|
|
"-func f1() { a() }",
|
|
"-func f2() { a(); b() }",
|
|
"-func f3() { a(); b(); }",
|
|
" func f1() { a() }",
|
|
" func f2() { a(); b() }",
|
|
" func f3() { a(); b(); }",
|
|
"+func g1() { a() }",
|
|
"+func g2() { a(); b() }",
|
|
"+func g3() { a(); b(); }"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "562c32409040414ebae043107d747062d5c5dd7f..32e57549e474090dbe83f869ba4e2cb0d15396e5"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-single-line-function-declarations-delete-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"single-line-function-declarations.go": [
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
1,
|
|
18
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'f1' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
2,
|
|
1
|
|
],
|
|
"end": [
|
|
2,
|
|
23
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'f2' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
3,
|
|
1
|
|
],
|
|
"end": [
|
|
3,
|
|
24
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'f3' function"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"single-line-function-declarations.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/single-line-function-declarations.go b/single-line-function-declarations.go",
|
|
"index 7fcb3a1..ef4196f 100644",
|
|
"--- a/single-line-function-declarations.go",
|
|
"+++ b/single-line-function-declarations.go",
|
|
"@@ -1,6 +1,3 @@",
|
|
"-func f1() { a() }",
|
|
"-func f2() { a(); b() }",
|
|
"-func f3() { a(); b(); }",
|
|
" func g1() { a() }",
|
|
" func g2() { a(); b() }",
|
|
" func g3() { a(); b(); }"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "32e57549e474090dbe83f869ba4e2cb0d15396e5..07ab506ba7a286cb5be0ef0b942b9404885a836d"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-single-line-function-declarations-delete-rest-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"single-line-function-declarations.go": [
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
1,
|
|
18
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'g1' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
2,
|
|
1
|
|
],
|
|
"end": [
|
|
2,
|
|
23
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'g2' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
3,
|
|
1
|
|
],
|
|
"end": [
|
|
3,
|
|
24
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'g3' function"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"single-line-function-declarations.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/single-line-function-declarations.go b/single-line-function-declarations.go",
|
|
"index ef4196f..e69de29 100644",
|
|
"--- a/single-line-function-declarations.go",
|
|
"+++ b/single-line-function-declarations.go",
|
|
"@@ -1,3 +0,0 @@",
|
|
"-func g1() { a() }",
|
|
"-func g2() { a(); b() }",
|
|
"-func g3() { a(); b(); }"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "07ab506ba7a286cb5be0ef0b942b9404885a836d..726da6b0b3b9f8a54b58dea6c03f9372250080bc"
|
|
}]
|