1
1
mirror of https://github.com/github/semantic.git synced 2024-12-23 14:54:16 +03:00
semantic/test/corpus/diff-summaries/go/modifying-struct-fields.json
2017-01-25 20:27:46 -05:00

347 lines
11 KiB
JSON

[{
"testCaseDescription": "go-modifying-struct-fields-setup-test",
"expectedResult": {
"changes": {
"modifying-struct-fields.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": [
"modifying-struct-fields.go"
],
"patch": [
"diff --git a/modifying-struct-fields.go b/modifying-struct-fields.go",
"index e69de29b..79058077 100644",
"--- a/modifying-struct-fields.go",
"+++ b/modifying-struct-fields.go",
"@@ -0,0 +1,5 @@",
"+package main",
"+",
"+func main() {",
"+",
"+}"
],
"gitDir": "test/corpus/repos/go",
"shas": "2194d7d2793533da82aa5e7279cde2b5cbfa70e9..66fb4240cc732e4143662a2b62d5ddfeb27de712"
}
,{
"testCaseDescription": "go-modifying-struct-fields-insert-test",
"expectedResult": {
"changes": {
"modifying-struct-fields.go": [
{
"span": {
"insert": {
"start": [
4,
1
],
"end": [
4,
4
]
}
},
"summary": "Added the 'ctx' identifier in the main function"
},
{
"span": {
"insert": {
"start": [
4,
8
],
"end": [
6,
2
]
}
},
"summary": "Added the '&uploadContext{\n Remote: remote\n}' operator in the main function"
}
]
},
"errors": {}
},
"filePaths": [
"modifying-struct-fields.go"
],
"patch": [
"diff --git a/modifying-struct-fields.go b/modifying-struct-fields.go",
"index 79058077..8b8c10e6 100644",
"--- a/modifying-struct-fields.go",
"+++ b/modifying-struct-fields.go",
"@@ -1,5 +1,7 @@",
" package main",
" ",
" func main() {",
"-",
"+ctx := &uploadContext{",
"+ Remote: remote",
"+}",
" }"
],
"gitDir": "test/corpus/repos/go",
"shas": "66fb4240cc732e4143662a2b62d5ddfeb27de712..f34ee7fa47df9575f9e51be89c42e666aa1c2772"
}
,{
"testCaseDescription": "go-modifying-struct-fields-replacement-test",
"expectedResult": {
"changes": {
"modifying-struct-fields.go": [
{
"span": {
"replace": [
{
"start": [
5,
4
],
"end": [
5,
18
]
},
{
"start": [
5,
4
],
"end": [
5,
35
]
}
]
},
"summary": "Replaced the 'Remote: remote' pair with the 'trackedLocksMu: new(sync.Mutex)' pair in the main function"
}
]
},
"errors": {}
},
"filePaths": [
"modifying-struct-fields.go"
],
"patch": [
"diff --git a/modifying-struct-fields.go b/modifying-struct-fields.go",
"index 8b8c10e6..e16cd243 100644",
"--- a/modifying-struct-fields.go",
"+++ b/modifying-struct-fields.go",
"@@ -2,6 +2,6 @@ package main",
" ",
" func main() {",
" ctx := &uploadContext{",
"- Remote: remote",
"+ trackedLocksMu: new(sync.Mutex)",
" }",
" }"
],
"gitDir": "test/corpus/repos/go",
"shas": "f34ee7fa47df9575f9e51be89c42e666aa1c2772..30ea7ed1c25c38f06f7274b5ca0793e6cb8e7f0f"
}
,{
"testCaseDescription": "go-modifying-struct-fields-delete-replacement-test",
"expectedResult": {
"changes": {
"modifying-struct-fields.go": [
{
"span": {
"replace": [
{
"start": [
5,
4
],
"end": [
5,
35
]
},
{
"start": [
5,
4
],
"end": [
5,
18
]
}
]
},
"summary": "Replaced the 'trackedLocksMu: new(sync.Mutex)' pair with the 'Remote: remote' pair in the main function"
}
]
},
"errors": {}
},
"filePaths": [
"modifying-struct-fields.go"
],
"patch": [
"diff --git a/modifying-struct-fields.go b/modifying-struct-fields.go",
"index e16cd243..8b8c10e6 100644",
"--- a/modifying-struct-fields.go",
"+++ b/modifying-struct-fields.go",
"@@ -2,6 +2,6 @@ package main",
" ",
" func main() {",
" ctx := &uploadContext{",
"- trackedLocksMu: new(sync.Mutex)",
"+ Remote: remote",
" }",
" }"
],
"gitDir": "test/corpus/repos/go",
"shas": "30ea7ed1c25c38f06f7274b5ca0793e6cb8e7f0f..217c17ebcbd80cc78ee728da0694e4ec0f2647e3"
}
,{
"testCaseDescription": "go-modifying-struct-fields-delete-insert-test",
"expectedResult": {
"changes": {
"modifying-struct-fields.go": [
{
"span": {
"delete": {
"start": [
4,
1
],
"end": [
4,
4
]
}
},
"summary": "Deleted the 'ctx' identifier in the main function"
},
{
"span": {
"delete": {
"start": [
4,
8
],
"end": [
6,
2
]
}
},
"summary": "Deleted the '&uploadContext{\n Remote: remote\n}' operator in the main function"
}
]
},
"errors": {}
},
"filePaths": [
"modifying-struct-fields.go"
],
"patch": [
"diff --git a/modifying-struct-fields.go b/modifying-struct-fields.go",
"index 8b8c10e6..79058077 100644",
"--- a/modifying-struct-fields.go",
"+++ b/modifying-struct-fields.go",
"@@ -1,7 +1,5 @@",
" package main",
" ",
" func main() {",
"-ctx := &uploadContext{",
"- Remote: remote",
"-}",
"+",
" }"
],
"gitDir": "test/corpus/repos/go",
"shas": "217c17ebcbd80cc78ee728da0694e4ec0f2647e3..75bacc85b0a8451954bfa270d0b01a8202c12aa8"
}
,{
"testCaseDescription": "go-modifying-struct-fields-teardown-test",
"expectedResult": {
"changes": {
"modifying-struct-fields.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": [
"modifying-struct-fields.go"
],
"patch": [
"diff --git a/modifying-struct-fields.go b/modifying-struct-fields.go",
"index 79058077..e69de29b 100644",
"--- a/modifying-struct-fields.go",
"+++ b/modifying-struct-fields.go",
"@@ -1,5 +0,0 @@",
"-package main",
"-",
"-func main() {",
"-",
"-}"
],
"gitDir": "test/corpus/repos/go",
"shas": "75bacc85b0a8451954bfa270d0b01a8202c12aa8..82c0a8349eb184a260e956992c6853e6dc73859b"
}]