mirror of
https://github.com/github/semantic.git
synced 2024-12-26 00:12:29 +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 e69de29b..79058077 100644",
|
|
"--- a/string-literals.go",
|
|
"+++ b/string-literals.go",
|
|
"@@ -0,0 +1,5 @@",
|
|
"+package main",
|
|
"+",
|
|
"+func main() {",
|
|
"+",
|
|
"+}"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "b72df7d6c7aedd3d34dd3b2f0aa0547d69e1ffe1..0b377fe4792f5202963a884fb4165b58ab9e5b86"
|
|
}
|
|
,{
|
|
"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 79058077..9a69966c 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": "0b377fe4792f5202963a884fb4165b58ab9e5b86..18417d193745676dcc2c91a68db21d6816224357"
|
|
}
|
|
,{
|
|
"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 9a69966c..fbbdb93e 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": "18417d193745676dcc2c91a68db21d6816224357..e1c4c6f633c0ba881845f5a97369ddb0ee992b3b"
|
|
}
|
|
,{
|
|
"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 fbbdb93e..9a69966c 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": "e1c4c6f633c0ba881845f5a97369ddb0ee992b3b..46e962571abe8550dd68805eb4525ab76d72333c"
|
|
}
|
|
,{
|
|
"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 9a69966c..79058077 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": "46e962571abe8550dd68805eb4525ab76d72333c..17b0499818d3e51ca3f5984542022905780b0e2c"
|
|
}
|
|
,{
|
|
"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 79058077..e69de29b 100644",
|
|
"--- a/string-literals.go",
|
|
"+++ b/string-literals.go",
|
|
"@@ -1,5 +0,0 @@",
|
|
"-package main",
|
|
"-",
|
|
"-func main() {",
|
|
"-",
|
|
"-}"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "17b0499818d3e51ca3f5984542022905780b0e2c..c44774b71e87e8c70f4e9470e9a8a2b8166ca535"
|
|
}]
|