1
1
mirror of https://github.com/github/semantic.git synced 2024-12-26 00:12:29 +03:00
semantic/test/corpus/diff-summaries/ruby/ternary.json

456 lines
14 KiB
JSON

[{
"testCaseDescription": "ruby-ternary-insert-test",
"expectedResult": {
"changes": {
"ternary.rb": [
{
"span": {
"insert": {
"start": [
1,
1
],
"end": [
1,
20
]
}
},
"summary": "Added the 'foo' ternary expression"
}
]
},
"errors": {}
},
"filePaths": [
"ternary.rb"
],
"patch": [
"diff --git a/ternary.rb b/ternary.rb",
"index e69de29..cc46e6d 100644",
"--- a/ternary.rb",
"+++ b/ternary.rb",
"@@ -0,0 +1 @@",
"+foo ? case1 : case2"
],
"gitDir": "test/corpus/repos/ruby",
"shas": "97f870df43868da61ab367aca7fcbfdf8a77aa00..e1f849d81b2f0565744fbf4f45a7cf54b924eae8"
}
,{
"testCaseDescription": "ruby-ternary-replacement-insert-test",
"expectedResult": {
"changes": {
"ternary.rb": [
{
"span": {
"insert": {
"start": [
1,
1
],
"end": [
1,
12
]
}
},
"summary": "Added the 'bar' ternary expression"
},
{
"span": {
"insert": {
"start": [
2,
1
],
"end": [
2,
20
]
}
},
"summary": "Added the 'foo' ternary expression"
}
]
},
"errors": {}
},
"filePaths": [
"ternary.rb"
],
"patch": [
"diff --git a/ternary.rb b/ternary.rb",
"index cc46e6d..44ee69e 100644",
"--- a/ternary.rb",
"+++ b/ternary.rb",
"@@ -1 +1,3 @@",
"+bar ? a : b",
"+foo ? case1 : case2",
" foo ? case1 : case2"
],
"gitDir": "test/corpus/repos/ruby",
"shas": "e1f849d81b2f0565744fbf4f45a7cf54b924eae8..15476ef40fd0d4fd9c8ae6157dc6039fbc450716"
}
,{
"testCaseDescription": "ruby-ternary-delete-insert-test",
"expectedResult": {
"changes": {
"ternary.rb": [
{
"span": {
"replace": [
{
"start": [
1,
1
],
"end": [
1,
4
]
},
{
"start": [
1,
1
],
"end": [
1,
4
]
}
]
},
"summary": "Replaced the 'bar' identifier with the 'foo' identifier in the 'foo' ternary expression"
},
{
"span": {
"replace": [
{
"start": [
1,
7
],
"end": [
1,
8
]
},
{
"start": [
1,
7
],
"end": [
1,
12
]
}
]
},
"summary": "Replaced the 'a' identifier with the 'case1' identifier in the 'foo' ternary expression"
},
{
"span": {
"replace": [
{
"start": [
1,
11
],
"end": [
1,
12
]
},
{
"start": [
1,
15
],
"end": [
1,
20
]
}
]
},
"summary": "Replaced the 'b' identifier with the 'case2' identifier in the 'foo' ternary expression"
}
]
},
"errors": {}
},
"filePaths": [
"ternary.rb"
],
"patch": [
"diff --git a/ternary.rb b/ternary.rb",
"index 44ee69e..86614c8 100644",
"--- a/ternary.rb",
"+++ b/ternary.rb",
"@@ -1,3 +1,3 @@",
"-bar ? a : b",
"+foo ? case1 : case2",
" foo ? case1 : case2",
" foo ? case1 : case2"
],
"gitDir": "test/corpus/repos/ruby",
"shas": "15476ef40fd0d4fd9c8ae6157dc6039fbc450716..0f6207e02eb77f9f87e4a2b7256e0a80f978adc8"
}
,{
"testCaseDescription": "ruby-ternary-replacement-test",
"expectedResult": {
"changes": {
"ternary.rb": [
{
"span": {
"replace": [
{
"start": [
1,
1
],
"end": [
1,
4
]
},
{
"start": [
1,
1
],
"end": [
1,
4
]
}
]
},
"summary": "Replaced the 'foo' identifier with the 'bar' identifier in the 'bar' ternary expression"
},
{
"span": {
"replace": [
{
"start": [
1,
7
],
"end": [
1,
12
]
},
{
"start": [
1,
7
],
"end": [
1,
8
]
}
]
},
"summary": "Replaced the 'case1' identifier with the 'a' identifier in the 'bar' ternary expression"
},
{
"span": {
"replace": [
{
"start": [
1,
15
],
"end": [
1,
20
]
},
{
"start": [
1,
11
],
"end": [
1,
12
]
}
]
},
"summary": "Replaced the 'case2' identifier with the 'b' identifier in the 'bar' ternary expression"
}
]
},
"errors": {}
},
"filePaths": [
"ternary.rb"
],
"patch": [
"diff --git a/ternary.rb b/ternary.rb",
"index 86614c8..44ee69e 100644",
"--- a/ternary.rb",
"+++ b/ternary.rb",
"@@ -1,3 +1,3 @@",
"-foo ? case1 : case2",
"+bar ? a : b",
" foo ? case1 : case2",
" foo ? case1 : case2"
],
"gitDir": "test/corpus/repos/ruby",
"shas": "0f6207e02eb77f9f87e4a2b7256e0a80f978adc8..1eb7b010282784002c1064e2433e57457e048cbb"
}
,{
"testCaseDescription": "ruby-ternary-delete-replacement-test",
"expectedResult": {
"changes": {
"ternary.rb": [
{
"span": {
"delete": {
"start": [
1,
1
],
"end": [
1,
12
]
}
},
"summary": "Deleted the 'bar' ternary expression"
},
{
"span": {
"delete": {
"start": [
2,
1
],
"end": [
2,
20
]
}
},
"summary": "Deleted the 'foo' ternary expression"
},
{
"span": {
"insert": {
"start": [
2,
1
],
"end": [
2,
12
]
}
},
"summary": "Added the 'bar' ternary expression"
}
]
},
"errors": {}
},
"filePaths": [
"ternary.rb"
],
"patch": [
"diff --git a/ternary.rb b/ternary.rb",
"index 44ee69e..1ce4e51 100644",
"--- a/ternary.rb",
"+++ b/ternary.rb",
"@@ -1,3 +1,2 @@",
"-bar ? a : b",
"-foo ? case1 : case2",
" foo ? case1 : case2",
"+bar ? a : b"
],
"gitDir": "test/corpus/repos/ruby",
"shas": "1eb7b010282784002c1064e2433e57457e048cbb..16fba8824d7b308daeae80ae16375ff007846b9b"
}
,{
"testCaseDescription": "ruby-ternary-delete-test",
"expectedResult": {
"changes": {
"ternary.rb": [
{
"span": {
"delete": {
"start": [
1,
1
],
"end": [
1,
20
]
}
},
"summary": "Deleted the 'foo' ternary expression"
}
]
},
"errors": {}
},
"filePaths": [
"ternary.rb"
],
"patch": [
"diff --git a/ternary.rb b/ternary.rb",
"index 1ce4e51..7f42328 100644",
"--- a/ternary.rb",
"+++ b/ternary.rb",
"@@ -1,2 +1 @@",
"-foo ? case1 : case2",
" bar ? a : b"
],
"gitDir": "test/corpus/repos/ruby",
"shas": "16fba8824d7b308daeae80ae16375ff007846b9b..0783eee8d94a9d7a8f7d590f0a9716617e145336"
}
,{
"testCaseDescription": "ruby-ternary-delete-rest-test",
"expectedResult": {
"changes": {
"ternary.rb": [
{
"span": {
"delete": {
"start": [
1,
1
],
"end": [
1,
12
]
}
},
"summary": "Deleted the 'bar' ternary expression"
}
]
},
"errors": {}
},
"filePaths": [
"ternary.rb"
],
"patch": [
"diff --git a/ternary.rb b/ternary.rb",
"index 7f42328..e69de29 100644",
"--- a/ternary.rb",
"+++ b/ternary.rb",
"@@ -1 +0,0 @@",
"-bar ? a : b"
],
"gitDir": "test/corpus/repos/ruby",
"shas": "0783eee8d94a9d7a8f7d590f0a9716617e145336..ec2870c9e829ba9514a3fc196f778f73f25ff514"
}]