mirror of
https://github.com/github/semantic.git
synced 2024-12-23 14:54:16 +03:00
407 lines
12 KiB
JSON
407 lines
12 KiB
JSON
[{
|
|
"testCaseDescription": "go-string-literals-setup-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"string-literals.go": [
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
1,
|
|
13
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
3,
|
|
1
|
|
],
|
|
"end": [
|
|
5,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'main' function"
|
|
}
|
|
]
|
|
},
|
|
"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": "111a29d8919459405b062e6b942e1eb353a4c571..879e196333676e2e209028280a5b27ccf8990358"
|
|
}
|
|
,{
|
|
"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"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
6,
|
|
1
|
|
],
|
|
"end": [
|
|
6,
|
|
18
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'b' var assignment in the main function"
|
|
}
|
|
]
|
|
},
|
|
"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": "879e196333676e2e209028280a5b27ccf8990358..0a3f4b6a944e998027a1dea4b59c291175c8c294"
|
|
}
|
|
,{
|
|
"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": "0a3f4b6a944e998027a1dea4b59c291175c8c294..e882dc00ae04399c338c4587e67a55454000673b"
|
|
}
|
|
,{
|
|
"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": "e882dc00ae04399c338c4587e67a55454000673b..f38767e8e0a90feb769766d682ebff6abcadcf1d"
|
|
}
|
|
,{
|
|
"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"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
6,
|
|
1
|
|
],
|
|
"end": [
|
|
6,
|
|
18
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'b' var assignment in the main function"
|
|
}
|
|
]
|
|
},
|
|
"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": "f38767e8e0a90feb769766d682ebff6abcadcf1d..23fc3a341ef22f53107931efaa78238e0d797010"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-string-literals-teardown-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"string-literals.go": [
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
1,
|
|
13
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
3,
|
|
1
|
|
],
|
|
"end": [
|
|
5,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'main' function"
|
|
}
|
|
]
|
|
},
|
|
"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": "23fc3a341ef22f53107931efaa78238e0d797010..5aa1aa94084ce9497716f1813f30f865da83f3ca"
|
|
}]
|