mirror of
https://github.com/github/semantic.git
synced 2024-12-23 23:11:50 +03:00
671 lines
22 KiB
JSON
671 lines
22 KiB
JSON
[{
|
|
"testCaseDescription": "go-struct-literals-setup-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"struct-literals.go": [
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
6,
|
|
1
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'main' module"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"struct-literals.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/struct-literals.go b/struct-literals.go",
|
|
"index e69de29..7905807 100644",
|
|
"--- a/struct-literals.go",
|
|
"+++ b/struct-literals.go",
|
|
"@@ -0,0 +1,5 @@",
|
|
"+package main",
|
|
"+",
|
|
"+func main() {",
|
|
"+",
|
|
"+}"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "621358b715438b3607a999075a384be3bfdc5d8e..c7c9cff4a487c563fd594baeab70ea68f3e5824f"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-struct-literals-insert-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"struct-literals.go": [
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
4,
|
|
1
|
|
],
|
|
"end": [
|
|
7,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 's1' variable in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
4,
|
|
1
|
|
],
|
|
"end": [
|
|
7,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'Person' variable in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
8,
|
|
1
|
|
],
|
|
"end": [
|
|
8,
|
|
32
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 's2' variable in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
8,
|
|
1
|
|
],
|
|
"end": [
|
|
8,
|
|
32
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'struct{i int;}' variable in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
9,
|
|
1
|
|
],
|
|
"end": [
|
|
9,
|
|
23
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 's3' variable in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
9,
|
|
1
|
|
],
|
|
"end": [
|
|
9,
|
|
23
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'time.Time' variable in the main function of the 'main' module"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"struct-literals.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/struct-literals.go b/struct-literals.go",
|
|
"index 7905807..e6fd4f1 100644",
|
|
"--- a/struct-literals.go",
|
|
"+++ b/struct-literals.go",
|
|
"@@ -1,5 +1,10 @@",
|
|
" package main",
|
|
" ",
|
|
" func main() {",
|
|
"-",
|
|
"+const s1 = Person{",
|
|
"+name: \"Frank\",",
|
|
"+Age: \"5 months\",",
|
|
"+}",
|
|
"+const s2 = struct{i int;}{i: 5}",
|
|
"+const s3 = time.Time{}",
|
|
" }"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "c7c9cff4a487c563fd594baeab70ea68f3e5824f..68f7a70b71c367f324b01e4390fc65ff6a6c85d1"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-struct-literals-replacement-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"struct-literals.go": [
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
4,
|
|
12
|
|
],
|
|
"end": [
|
|
4,
|
|
18
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
4,
|
|
12
|
|
],
|
|
"end": [
|
|
4,
|
|
15
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'Person' identifier with the 'Dog' identifier in the Dog struct of the 'main' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
8,
|
|
21
|
|
],
|
|
"end": [
|
|
8,
|
|
24
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
8,
|
|
21
|
|
],
|
|
"end": [
|
|
8,
|
|
26
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'int' identifier with the 'float' identifier in the struct{i float;} struct of the 'main' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
8,
|
|
27
|
|
],
|
|
"end": [
|
|
8,
|
|
28
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
8,
|
|
29
|
|
],
|
|
"end": [
|
|
8,
|
|
30
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'i' identifier with the 'j' identifier in the struct{i float;} struct of the 'main' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
8,
|
|
30
|
|
],
|
|
"end": [
|
|
8,
|
|
31
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
8,
|
|
32
|
|
],
|
|
"end": [
|
|
8,
|
|
33
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced '5' with '6' in the struct{i float;} struct of the 'main' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
9,
|
|
17
|
|
],
|
|
"end": [
|
|
9,
|
|
21
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
9,
|
|
17
|
|
],
|
|
"end": [
|
|
9,
|
|
22
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'Time' identifier with the 'Month' identifier in the time.Month struct of the 'main' function"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"struct-literals.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/struct-literals.go b/struct-literals.go",
|
|
"index e6fd4f1..06724a4 100644",
|
|
"--- a/struct-literals.go",
|
|
"+++ b/struct-literals.go",
|
|
"@@ -1,10 +1,10 @@",
|
|
" package main",
|
|
" ",
|
|
" func main() {",
|
|
"-const s1 = Person{",
|
|
"+const s1 = Dog{",
|
|
" name: \"Frank\",",
|
|
" Age: \"5 months\",",
|
|
" }",
|
|
"-const s2 = struct{i int;}{i: 5}",
|
|
"-const s3 = time.Time{}",
|
|
"+const s2 = struct{i float;}{j: 6}",
|
|
"+const s3 = time.Month{}",
|
|
" }"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "68f7a70b71c367f324b01e4390fc65ff6a6c85d1..d7c78227a597356e5e0b6611e59a1e6e316c7c32"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-struct-literals-delete-replacement-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"struct-literals.go": [
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
4,
|
|
12
|
|
],
|
|
"end": [
|
|
4,
|
|
15
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
4,
|
|
12
|
|
],
|
|
"end": [
|
|
4,
|
|
18
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'Dog' identifier with the 'Person' identifier in the Person struct of the 'main' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
8,
|
|
21
|
|
],
|
|
"end": [
|
|
8,
|
|
26
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
8,
|
|
21
|
|
],
|
|
"end": [
|
|
8,
|
|
24
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'float' identifier with the 'int' identifier in the struct{i int;} struct of the 'main' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
8,
|
|
29
|
|
],
|
|
"end": [
|
|
8,
|
|
30
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
8,
|
|
27
|
|
],
|
|
"end": [
|
|
8,
|
|
28
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'j' identifier with the 'i' identifier in the struct{i int;} struct of the 'main' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
8,
|
|
32
|
|
],
|
|
"end": [
|
|
8,
|
|
33
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
8,
|
|
30
|
|
],
|
|
"end": [
|
|
8,
|
|
31
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced '6' with '5' in the struct{i int;} struct of the 'main' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
9,
|
|
17
|
|
],
|
|
"end": [
|
|
9,
|
|
22
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
9,
|
|
17
|
|
],
|
|
"end": [
|
|
9,
|
|
21
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'Month' identifier with the 'Time' identifier in the time.Time struct of the 'main' function"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"struct-literals.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/struct-literals.go b/struct-literals.go",
|
|
"index 06724a4..e6fd4f1 100644",
|
|
"--- a/struct-literals.go",
|
|
"+++ b/struct-literals.go",
|
|
"@@ -1,10 +1,10 @@",
|
|
" package main",
|
|
" ",
|
|
" func main() {",
|
|
"-const s1 = Dog{",
|
|
"+const s1 = Person{",
|
|
" name: \"Frank\",",
|
|
" Age: \"5 months\",",
|
|
" }",
|
|
"-const s2 = struct{i float;}{j: 6}",
|
|
"-const s3 = time.Month{}",
|
|
"+const s2 = struct{i int;}{i: 5}",
|
|
"+const s3 = time.Time{}",
|
|
" }"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "d7c78227a597356e5e0b6611e59a1e6e316c7c32..db11b9059d23b05ada714fc2c5df3735794e5718"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-struct-literals-delete-insert-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"struct-literals.go": [
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
4,
|
|
1
|
|
],
|
|
"end": [
|
|
7,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 's1' variable in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
4,
|
|
1
|
|
],
|
|
"end": [
|
|
7,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'Person' variable in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
8,
|
|
1
|
|
],
|
|
"end": [
|
|
8,
|
|
32
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 's2' variable in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
8,
|
|
1
|
|
],
|
|
"end": [
|
|
8,
|
|
32
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'struct{i int;}' variable in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
9,
|
|
1
|
|
],
|
|
"end": [
|
|
9,
|
|
23
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 's3' variable in the main function of the 'main' module"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
9,
|
|
1
|
|
],
|
|
"end": [
|
|
9,
|
|
23
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'time.Time' variable in the main function of the 'main' module"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"struct-literals.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/struct-literals.go b/struct-literals.go",
|
|
"index e6fd4f1..7905807 100644",
|
|
"--- a/struct-literals.go",
|
|
"+++ b/struct-literals.go",
|
|
"@@ -1,10 +1,5 @@",
|
|
" package main",
|
|
" ",
|
|
" func main() {",
|
|
"-const s1 = Person{",
|
|
"-name: \"Frank\",",
|
|
"-Age: \"5 months\",",
|
|
"-}",
|
|
"-const s2 = struct{i int;}{i: 5}",
|
|
"-const s3 = time.Time{}",
|
|
"+",
|
|
" }"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "db11b9059d23b05ada714fc2c5df3735794e5718..d6c7b370e73c65486b9bddc81e758e61985484d6"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-struct-literals-teardown-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"struct-literals.go": [
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
6,
|
|
1
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'main' module"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"struct-literals.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/struct-literals.go b/struct-literals.go",
|
|
"index 7905807..e69de29 100644",
|
|
"--- a/struct-literals.go",
|
|
"+++ b/struct-literals.go",
|
|
"@@ -1,5 +0,0 @@",
|
|
"-package main",
|
|
"-",
|
|
"-func main() {",
|
|
"-",
|
|
"-}"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "d6c7b370e73c65486b9bddc81e758e61985484d6..3f34a10b2e6608640c4757f2d2fdb8f26b3c0936"
|
|
}]
|