mirror of
https://github.com/github/semantic.git
synced 2024-12-24 23:42:31 +03:00
377 lines
12 KiB
JSON
377 lines
12 KiB
JSON
[{
|
|
"testCaseDescription": "go-string-literals-setup-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"string-literals.go": [
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
6,
|
|
1
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'main' module"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"string-literals.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/string-literals.go b/string-literals.go",
|
|
"index e69de29..7905807 100644",
|
|
"--- a/string-literals.go",
|
|
"+++ b/string-literals.go",
|
|
"@@ -0,0 +1,5 @@",
|
|
"+package main",
|
|
"+",
|
|
"+func main() {",
|
|
"+",
|
|
"+}"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "82995a356477b94c28f13f84e7c705e71bb610b2..26b69b34f0334736674c97d9fe6482e5c3f792b8"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-string-literals-insert-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"string-literals.go": [
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
5,
|
|
1
|
|
],
|
|
"end": [
|
|
5,
|
|
8
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'a' var assignment in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
6,
|
|
1
|
|
],
|
|
"end": [
|
|
6,
|
|
18
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'b' var assignment in the main function of the 'main' module"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"string-literals.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/string-literals.go b/string-literals.go",
|
|
"index 7905807..9a69966 100644",
|
|
"--- a/string-literals.go",
|
|
"+++ b/string-literals.go",
|
|
"@@ -1,5 +1,8 @@",
|
|
" package main",
|
|
" ",
|
|
" func main() {",
|
|
"-",
|
|
"+const (",
|
|
"+a = \"0\"",
|
|
"+b = \"hello world\"",
|
|
"+)",
|
|
" }"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "26b69b34f0334736674c97d9fe6482e5c3f792b8..dbc8c044c144046ae9596f066fa85ff5689a1529"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-string-literals-replacement-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"string-literals.go": [
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
5,
|
|
5
|
|
],
|
|
"end": [
|
|
5,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
5,
|
|
5
|
|
],
|
|
"end": [
|
|
5,
|
|
8
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the \"0\" string with the \"2\" string in the a var assignment of the 'main' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
6,
|
|
5
|
|
],
|
|
"end": [
|
|
6,
|
|
18
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
6,
|
|
5
|
|
],
|
|
"end": [
|
|
6,
|
|
9
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the \"hello world\" string with the \"hi\" string in the b var assignment of the 'main' function"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"string-literals.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/string-literals.go b/string-literals.go",
|
|
"index 9a69966..fbbdb93 100644",
|
|
"--- a/string-literals.go",
|
|
"+++ b/string-literals.go",
|
|
"@@ -2,7 +2,7 @@ package main",
|
|
" ",
|
|
" func main() {",
|
|
" const (",
|
|
"-a = \"0\"",
|
|
"-b = \"hello world\"",
|
|
"+a = \"2\"",
|
|
"+b = \"hi\"",
|
|
" )",
|
|
" }"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "dbc8c044c144046ae9596f066fa85ff5689a1529..263d7b106eb4521f1232d4daddf0f9b02ab5d5df"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-string-literals-delete-replacement-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"string-literals.go": [
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
5,
|
|
5
|
|
],
|
|
"end": [
|
|
5,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
5,
|
|
5
|
|
],
|
|
"end": [
|
|
5,
|
|
8
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the \"2\" string with the \"0\" string in the a var assignment of the 'main' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
6,
|
|
5
|
|
],
|
|
"end": [
|
|
6,
|
|
9
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
6,
|
|
5
|
|
],
|
|
"end": [
|
|
6,
|
|
18
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the \"hi\" string with the \"hello world\" string in the b var assignment of the 'main' function"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"string-literals.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/string-literals.go b/string-literals.go",
|
|
"index fbbdb93..9a69966 100644",
|
|
"--- a/string-literals.go",
|
|
"+++ b/string-literals.go",
|
|
"@@ -2,7 +2,7 @@ package main",
|
|
" ",
|
|
" func main() {",
|
|
" const (",
|
|
"-a = \"2\"",
|
|
"-b = \"hi\"",
|
|
"+a = \"0\"",
|
|
"+b = \"hello world\"",
|
|
" )",
|
|
" }"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "263d7b106eb4521f1232d4daddf0f9b02ab5d5df..c333d9867baaadb665c02382119d2e33eb8a65e7"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-string-literals-delete-insert-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"string-literals.go": [
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
5,
|
|
1
|
|
],
|
|
"end": [
|
|
5,
|
|
8
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'a' var assignment in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
6,
|
|
1
|
|
],
|
|
"end": [
|
|
6,
|
|
18
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'b' var assignment in the main function of the 'main' module"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"string-literals.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/string-literals.go b/string-literals.go",
|
|
"index 9a69966..7905807 100644",
|
|
"--- a/string-literals.go",
|
|
"+++ b/string-literals.go",
|
|
"@@ -1,8 +1,5 @@",
|
|
" package main",
|
|
" ",
|
|
" func main() {",
|
|
"-const (",
|
|
"-a = \"0\"",
|
|
"-b = \"hello world\"",
|
|
"-)",
|
|
"+",
|
|
" }"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "c333d9867baaadb665c02382119d2e33eb8a65e7..8d930fe95a747d900468af51ef49a224eb77ef52"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-string-literals-teardown-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"string-literals.go": [
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
6,
|
|
1
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'main' module"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"string-literals.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/string-literals.go b/string-literals.go",
|
|
"index 7905807..e69de29 100644",
|
|
"--- a/string-literals.go",
|
|
"+++ b/string-literals.go",
|
|
"@@ -1,5 +0,0 @@",
|
|
"-package main",
|
|
"-",
|
|
"-func main() {",
|
|
"-",
|
|
"-}"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "8d930fe95a747d900468af51ef49a224eb77ef52..250675f9851f6cab4d70c5505bc7781de836c288"
|
|
}]
|