1
1
mirror of https://github.com/github/semantic.git synced 2024-12-24 23:42:31 +03:00
semantic/test/corpus/diff-summaries/ruby/when-else.json
2017-01-25 20:27:46 -05:00

275 lines
7.8 KiB
JSON

[{
"testCaseDescription": "ruby-when-else-setup-test",
"expectedResult": {
"changes": {
"when-else.rb": [
{
"span": {
"insert": {
"start": [
1,
1
],
"end": [
4,
4
]
}
},
"summary": "Added the 'foo' case statement"
}
]
},
"errors": {}
},
"filePaths": [
"when-else.rb"
],
"patch": [
"diff --git a/when-else.rb b/when-else.rb",
"index e69de29..3c8eff2 100644",
"--- a/when-else.rb",
"+++ b/when-else.rb",
"@@ -0,0 +1,4 @@",
"+case foo",
"+when bar",
"+ baz",
"+end"
],
"gitDir": "test/corpus/repos/ruby",
"shas": "ab2392769172febef7b317850a4e30bb8ee02326..9cc96d5add1c5242be5da44a4567ee2f06ec8e02"
}
,{
"testCaseDescription": "ruby-when-else-insert-test",
"expectedResult": {
"changes": {
"when-else.rb": [
{
"span": {
"insert": {
"start": [
4,
1
],
"end": [
4,
5
]
}
},
"summary": "Added an else block in the 'foo' case statement"
}
]
},
"errors": {}
},
"filePaths": [
"when-else.rb"
],
"patch": [
"diff --git a/when-else.rb b/when-else.rb",
"index 3c8eff2..fb2be92 100644",
"--- a/when-else.rb",
"+++ b/when-else.rb",
"@@ -1,4 +1,5 @@",
" case foo",
" when bar",
" baz",
"+else",
" end"
],
"gitDir": "test/corpus/repos/ruby",
"shas": "9cc96d5add1c5242be5da44a4567ee2f06ec8e02..d56b1e0728e80c70b9d98f079f5845d418116deb"
}
,{
"testCaseDescription": "ruby-when-else-replacement-test",
"expectedResult": {
"changes": {
"when-else.rb": [
{
"span": {
"replace": [
{
"start": [
4,
1
],
"end": [
4,
5
]
},
{
"start": [
5,
3
],
"end": [
5,
6
]
}
]
},
"summary": "Replaced an else block with the 'qoz' identifier in the 'foo' case statement"
}
]
},
"errors": {}
},
"filePaths": [
"when-else.rb"
],
"patch": [
"diff --git a/when-else.rb b/when-else.rb",
"index fb2be92..028bb59 100644",
"--- a/when-else.rb",
"+++ b/when-else.rb",
"@@ -2,4 +2,5 @@ case foo",
" when bar",
" baz",
" else",
"+ qoz",
" end"
],
"gitDir": "test/corpus/repos/ruby",
"shas": "d56b1e0728e80c70b9d98f079f5845d418116deb..3620c1d25d6dd0b4bff9c00b49b3bb6e815a913c"
}
,{
"testCaseDescription": "ruby-when-else-delete-replacement-test",
"expectedResult": {
"changes": {
"when-else.rb": [
{
"span": {
"replace": [
{
"start": [
5,
3
],
"end": [
5,
6
]
},
{
"start": [
4,
1
],
"end": [
4,
5
]
}
]
},
"summary": "Replaced the 'qoz' identifier with an else block in the 'foo' case statement"
}
]
},
"errors": {}
},
"filePaths": [
"when-else.rb"
],
"patch": [
"diff --git a/when-else.rb b/when-else.rb",
"index 028bb59..fb2be92 100644",
"--- a/when-else.rb",
"+++ b/when-else.rb",
"@@ -2,5 +2,4 @@ case foo",
" when bar",
" baz",
" else",
"- qoz",
" end"
],
"gitDir": "test/corpus/repos/ruby",
"shas": "3620c1d25d6dd0b4bff9c00b49b3bb6e815a913c..38b9c0e304b24a49fea228691d5efae98ee67f94"
}
,{
"testCaseDescription": "ruby-when-else-delete-insert-test",
"expectedResult": {
"changes": {
"when-else.rb": [
{
"span": {
"delete": {
"start": [
4,
1
],
"end": [
4,
5
]
}
},
"summary": "Deleted an else block in the 'foo' case statement"
}
]
},
"errors": {}
},
"filePaths": [
"when-else.rb"
],
"patch": [
"diff --git a/when-else.rb b/when-else.rb",
"index fb2be92..3c8eff2 100644",
"--- a/when-else.rb",
"+++ b/when-else.rb",
"@@ -1,5 +1,4 @@",
" case foo",
" when bar",
" baz",
"-else",
" end"
],
"gitDir": "test/corpus/repos/ruby",
"shas": "38b9c0e304b24a49fea228691d5efae98ee67f94..5b0e767bd89ea3fe8975c480938f56124daa7518"
}
,{
"testCaseDescription": "ruby-when-else-teardown-test",
"expectedResult": {
"changes": {
"when-else.rb": [
{
"span": {
"delete": {
"start": [
1,
1
],
"end": [
4,
4
]
}
},
"summary": "Deleted the 'foo' case statement"
}
]
},
"errors": {}
},
"filePaths": [
"when-else.rb"
],
"patch": [
"diff --git a/when-else.rb b/when-else.rb",
"index 3c8eff2..e69de29 100644",
"--- a/when-else.rb",
"+++ b/when-else.rb",
"@@ -1,4 +0,0 @@",
"-case foo",
"-when bar",
"- baz",
"-end"
],
"gitDir": "test/corpus/repos/ruby",
"shas": "5b0e767bd89ea3fe8975c480938f56124daa7518..13b54918666502353431828fabfae483e79016f6"
}]