mirror of
https://github.com/github/semantic.git
synced 2024-12-23 14:54:16 +03:00
866 lines
28 KiB
JSON
866 lines
28 KiB
JSON
[{
|
|
"testCaseDescription": "go-struct-literals-insert-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"struct-literals.go": [
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
4,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 's1' variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
5,
|
|
1
|
|
],
|
|
"end": [
|
|
5,
|
|
32
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 's2' variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
6,
|
|
1
|
|
],
|
|
"end": [
|
|
6,
|
|
23
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 's3' variable"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"struct-literals.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/struct-literals.go b/struct-literals.go",
|
|
"index e69de29..f949dbb 100644",
|
|
"--- a/struct-literals.go",
|
|
"+++ b/struct-literals.go",
|
|
"@@ -0,0 +1,6 @@",
|
|
"+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": "cd582e9b85e985f87af52085296e006987e8b0d3..6c9bcc47bf47a86de621d89270a4d7d62dd8241c"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-struct-literals-replacement-insert-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"struct-literals.go": [
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
4,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 's1' variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
5,
|
|
1
|
|
],
|
|
"end": [
|
|
5,
|
|
34
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 's2' variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
6,
|
|
1
|
|
],
|
|
"end": [
|
|
6,
|
|
24
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 's3' variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
7,
|
|
1
|
|
],
|
|
"end": [
|
|
10,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 's1' variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
11,
|
|
1
|
|
],
|
|
"end": [
|
|
11,
|
|
32
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 's2' variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
12,
|
|
1
|
|
],
|
|
"end": [
|
|
12,
|
|
23
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 's3' variable"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"struct-literals.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/struct-literals.go b/struct-literals.go",
|
|
"index f949dbb..c6a242e 100644",
|
|
"--- a/struct-literals.go",
|
|
"+++ b/struct-literals.go",
|
|
"@@ -1,3 +1,15 @@",
|
|
"+const s1 = Dog{",
|
|
"+name: \"Frank\",",
|
|
"+Age: \"5 months\",",
|
|
"+}",
|
|
"+const s2 = struct{i float;}{j: 6}",
|
|
"+const s3 = time.Month{}",
|
|
"+const s1 = Person{",
|
|
"+name: \"Frank\",",
|
|
"+Age: \"5 months\",",
|
|
"+}",
|
|
"+const s2 = struct{i int;}{i: 5}",
|
|
"+const s3 = time.Time{}",
|
|
" const s1 = Person{",
|
|
" name: \"Frank\",",
|
|
" Age: \"5 months\","
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "6c9bcc47bf47a86de621d89270a4d7d62dd8241c..549bd62659cc4988bc02a8deb069747ea8efc519"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-struct-literals-delete-insert-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"struct-literals.go": [
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
1,
|
|
12
|
|
],
|
|
"end": [
|
|
1,
|
|
15
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
1,
|
|
12
|
|
],
|
|
"end": [
|
|
1,
|
|
18
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'Dog' identifier with the 'Person' identifier in the s1 variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
5,
|
|
21
|
|
],
|
|
"end": [
|
|
5,
|
|
26
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
5,
|
|
21
|
|
],
|
|
"end": [
|
|
5,
|
|
24
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'float' identifier with the 'int' identifier in the s2 variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
5,
|
|
29
|
|
],
|
|
"end": [
|
|
5,
|
|
30
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
5,
|
|
27
|
|
],
|
|
"end": [
|
|
5,
|
|
28
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'j' identifier with the 'i' identifier in the s2 variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
5,
|
|
32
|
|
],
|
|
"end": [
|
|
5,
|
|
33
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
5,
|
|
30
|
|
],
|
|
"end": [
|
|
5,
|
|
31
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced '6' with '5' in the s2 variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
6,
|
|
17
|
|
],
|
|
"end": [
|
|
6,
|
|
22
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
6,
|
|
17
|
|
],
|
|
"end": [
|
|
6,
|
|
21
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'Month' identifier with the 'Time' identifier in the s3 variable"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"struct-literals.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/struct-literals.go b/struct-literals.go",
|
|
"index c6a242e..680652e 100644",
|
|
"--- a/struct-literals.go",
|
|
"+++ b/struct-literals.go",
|
|
"@@ -1,9 +1,9 @@",
|
|
"-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{}",
|
|
" const s1 = Person{",
|
|
" name: \"Frank\",",
|
|
" Age: \"5 months\","
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "549bd62659cc4988bc02a8deb069747ea8efc519..02d890ec6a09db8058f6a825c4f81f4c0abcfa38"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-struct-literals-replacement-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"struct-literals.go": [
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
1,
|
|
12
|
|
],
|
|
"end": [
|
|
1,
|
|
18
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
1,
|
|
12
|
|
],
|
|
"end": [
|
|
1,
|
|
15
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'Person' identifier with the 'Dog' identifier in the s1 variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
5,
|
|
21
|
|
],
|
|
"end": [
|
|
5,
|
|
24
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
5,
|
|
21
|
|
],
|
|
"end": [
|
|
5,
|
|
26
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'int' identifier with the 'float' identifier in the s2 variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
5,
|
|
27
|
|
],
|
|
"end": [
|
|
5,
|
|
28
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
5,
|
|
29
|
|
],
|
|
"end": [
|
|
5,
|
|
30
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'i' identifier with the 'j' identifier in the s2 variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
5,
|
|
30
|
|
],
|
|
"end": [
|
|
5,
|
|
31
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
5,
|
|
32
|
|
],
|
|
"end": [
|
|
5,
|
|
33
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced '5' with '6' in the s2 variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
6,
|
|
17
|
|
],
|
|
"end": [
|
|
6,
|
|
21
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
6,
|
|
17
|
|
],
|
|
"end": [
|
|
6,
|
|
22
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'Time' identifier with the 'Month' identifier in the s3 variable"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"struct-literals.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/struct-literals.go b/struct-literals.go",
|
|
"index 680652e..c6a242e 100644",
|
|
"--- a/struct-literals.go",
|
|
"+++ b/struct-literals.go",
|
|
"@@ -1,9 +1,9 @@",
|
|
"-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{}",
|
|
" const s1 = Person{",
|
|
" name: \"Frank\",",
|
|
" Age: \"5 months\","
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "02d890ec6a09db8058f6a825c4f81f4c0abcfa38..3e8f6a306606b2698b9733e5f66cd359a7563b3d"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-struct-literals-delete-replacement-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"struct-literals.go": [
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
4,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 's1' variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
5,
|
|
1
|
|
],
|
|
"end": [
|
|
5,
|
|
34
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 's2' variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
6,
|
|
1
|
|
],
|
|
"end": [
|
|
6,
|
|
24
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 's3' variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
7,
|
|
1
|
|
],
|
|
"end": [
|
|
10,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 's1' variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
11,
|
|
1
|
|
],
|
|
"end": [
|
|
11,
|
|
32
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 's2' variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
12,
|
|
1
|
|
],
|
|
"end": [
|
|
12,
|
|
23
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 's3' variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
7,
|
|
1
|
|
],
|
|
"end": [
|
|
10,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 's1' variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
11,
|
|
1
|
|
],
|
|
"end": [
|
|
11,
|
|
34
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 's2' variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
12,
|
|
1
|
|
],
|
|
"end": [
|
|
12,
|
|
24
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 's3' variable"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"struct-literals.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/struct-literals.go b/struct-literals.go",
|
|
"index c6a242e..5aaf236 100644",
|
|
"--- a/struct-literals.go",
|
|
"+++ b/struct-literals.go",
|
|
"@@ -1,18 +1,12 @@",
|
|
"-const s1 = Dog{",
|
|
"-name: \"Frank\",",
|
|
"-Age: \"5 months\",",
|
|
"-}",
|
|
"-const s2 = struct{i float;}{j: 6}",
|
|
"-const s3 = time.Month{}",
|
|
" const s1 = Person{",
|
|
" name: \"Frank\",",
|
|
" Age: \"5 months\",",
|
|
" }",
|
|
" const s2 = struct{i int;}{i: 5}",
|
|
" const s3 = time.Time{}",
|
|
"-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": "3e8f6a306606b2698b9733e5f66cd359a7563b3d..9e036681bd0abc57a429a77198d02f726efff075"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-struct-literals-delete-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"struct-literals.go": [
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
4,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 's1' variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
5,
|
|
1
|
|
],
|
|
"end": [
|
|
5,
|
|
32
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 's2' variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
6,
|
|
1
|
|
],
|
|
"end": [
|
|
6,
|
|
23
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 's3' variable"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"struct-literals.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/struct-literals.go b/struct-literals.go",
|
|
"index 5aaf236..9f5ac64 100644",
|
|
"--- a/struct-literals.go",
|
|
"+++ b/struct-literals.go",
|
|
"@@ -1,9 +1,3 @@",
|
|
"-const s1 = Person{",
|
|
"-name: \"Frank\",",
|
|
"-Age: \"5 months\",",
|
|
"-}",
|
|
"-const s2 = struct{i int;}{i: 5}",
|
|
"-const s3 = time.Time{}",
|
|
" const s1 = Dog{",
|
|
" name: \"Frank\",",
|
|
" Age: \"5 months\","
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "9e036681bd0abc57a429a77198d02f726efff075..0cabca264829090bbcca8324cad7d2ef6d0a4c1c"
|
|
}
|
|
,{
|
|
"testCaseDescription": "go-struct-literals-delete-rest-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"struct-literals.go": [
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
4,
|
|
2
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 's1' variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
5,
|
|
1
|
|
],
|
|
"end": [
|
|
5,
|
|
34
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 's2' variable"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
6,
|
|
1
|
|
],
|
|
"end": [
|
|
6,
|
|
24
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 's3' variable"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"struct-literals.go"
|
|
],
|
|
"patch": [
|
|
"diff --git a/struct-literals.go b/struct-literals.go",
|
|
"index 9f5ac64..e69de29 100644",
|
|
"--- a/struct-literals.go",
|
|
"+++ b/struct-literals.go",
|
|
"@@ -1,6 +0,0 @@",
|
|
"-const s1 = Dog{",
|
|
"-name: \"Frank\",",
|
|
"-Age: \"5 months\",",
|
|
"-}",
|
|
"-const s2 = struct{i float;}{j: 6}",
|
|
"-const s3 = time.Month{}"
|
|
],
|
|
"gitDir": "test/corpus/repos/go",
|
|
"shas": "0cabca264829090bbcca8324cad7d2ef6d0a4c1c..1afdfc9d2ffbe4b43ec47892c4583237f382efd2"
|
|
}]
|