mirror of
https://github.com/github/semantic.git
synced 2024-12-23 23:11:50 +03:00
327 lines
10 KiB
JSON
327 lines
10 KiB
JSON
[{
|
|
"testCaseDescription": "ruby-ternary-insert-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"ternary.rb": [
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
1,
|
|
26
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'condition' ternary expression"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"ternary.rb"
|
|
],
|
|
"patch": [
|
|
"diff --git a/ternary.rb b/ternary.rb",
|
|
"index e69de29..698a2e2 100644",
|
|
"--- a/ternary.rb",
|
|
"+++ b/ternary.rb",
|
|
"@@ -0,0 +1 @@",
|
|
"+condition ? case1 : case2"
|
|
],
|
|
"gitDir": "test/corpus/repos/ruby",
|
|
"shas": "8b196e55798c1a5f125a87a869f770dca83665d6..1a0db6a903f49194d0c751f04a2ca21c8d61e4f4"
|
|
}
|
|
,{
|
|
"testCaseDescription": "ruby-ternary-replacement-insert-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"ternary.rb": [
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
1,
|
|
26
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
4,
|
|
1
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'condition' ternary expression with the 'if condition then case 1 else case2\ncondition ? case1 : case2\ncondition ? case1 : case2\n' at line 1, column 1 - line 4, column 1"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"ternary.rb"
|
|
],
|
|
"patch": [
|
|
"diff --git a/ternary.rb b/ternary.rb",
|
|
"index 698a2e2..38cd95f 100644",
|
|
"--- a/ternary.rb",
|
|
"+++ b/ternary.rb",
|
|
"@@ -1 +1,3 @@",
|
|
"+if condition then case 1 else case2",
|
|
"+condition ? case1 : case2",
|
|
" condition ? case1 : case2"
|
|
],
|
|
"gitDir": "test/corpus/repos/ruby",
|
|
"shas": "1a0db6a903f49194d0c751f04a2ca21c8d61e4f4..97b73670c8421489a1e1ff4b572971d0791b08d5"
|
|
}
|
|
,{
|
|
"testCaseDescription": "ruby-ternary-delete-insert-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"ternary.rb": [
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
4,
|
|
1
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
1,
|
|
26
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'if condition then case 1 else case2\ncondition ? case1 : case2\ncondition ? case1 : case2\n' at line 1, column 1 - line 4, column 1 with the 'condition' ternary expression"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"ternary.rb"
|
|
],
|
|
"patch": [
|
|
"diff --git a/ternary.rb b/ternary.rb",
|
|
"index 38cd95f..411fded 100644",
|
|
"--- a/ternary.rb",
|
|
"+++ b/ternary.rb",
|
|
"@@ -1,3 +1,3 @@",
|
|
"-if condition then case 1 else case2",
|
|
"+condition ? case1 : case2",
|
|
" condition ? case1 : case2",
|
|
" condition ? case1 : case2"
|
|
],
|
|
"gitDir": "test/corpus/repos/ruby",
|
|
"shas": "97b73670c8421489a1e1ff4b572971d0791b08d5..4c0f3c25fcb3fd88274f0661a2f66986d5eede3c"
|
|
}
|
|
,{
|
|
"testCaseDescription": "ruby-ternary-replacement-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"ternary.rb": [
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
1,
|
|
26
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
4,
|
|
1
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'condition' ternary expression with the 'if condition then case 1 else case2\ncondition ? case1 : case2\ncondition ? case1 : case2\n' at line 1, column 1 - line 4, column 1"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"ternary.rb"
|
|
],
|
|
"patch": [
|
|
"diff --git a/ternary.rb b/ternary.rb",
|
|
"index 411fded..38cd95f 100644",
|
|
"--- a/ternary.rb",
|
|
"+++ b/ternary.rb",
|
|
"@@ -1,3 +1,3 @@",
|
|
"-condition ? case1 : case2",
|
|
"+if condition then case 1 else case2",
|
|
" condition ? case1 : case2",
|
|
" condition ? case1 : case2"
|
|
],
|
|
"gitDir": "test/corpus/repos/ruby",
|
|
"shas": "4c0f3c25fcb3fd88274f0661a2f66986d5eede3c..11b4c54fcdb1ddcda1de2d340bec6aa102c7fd4a"
|
|
}
|
|
,{
|
|
"testCaseDescription": "ruby-ternary-delete-replacement-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"ternary.rb": [
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
4,
|
|
1
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
1,
|
|
26
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'if condition then case 1 else case2\ncondition ? case1 : case2\ncondition ? case1 : case2\n' at line 1, column 1 - line 4, column 1 with the 'condition' ternary expression"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"ternary.rb"
|
|
],
|
|
"patch": [
|
|
"diff --git a/ternary.rb b/ternary.rb",
|
|
"index 38cd95f..32b2056 100644",
|
|
"--- a/ternary.rb",
|
|
"+++ b/ternary.rb",
|
|
"@@ -1,3 +1,2 @@",
|
|
"-if condition then case 1 else case2",
|
|
"-condition ? case1 : case2",
|
|
" condition ? case1 : case2",
|
|
"+if condition then case 1 else case2"
|
|
],
|
|
"gitDir": "test/corpus/repos/ruby",
|
|
"shas": "11b4c54fcdb1ddcda1de2d340bec6aa102c7fd4a..7b67feda158a6c6ae27b09770dc435df1f5e8201"
|
|
}
|
|
,{
|
|
"testCaseDescription": "ruby-ternary-delete-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"ternary.rb": [
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
1,
|
|
26
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'condition' ternary expression"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"ternary.rb"
|
|
],
|
|
"patch": [
|
|
"diff --git a/ternary.rb b/ternary.rb",
|
|
"index 32b2056..f53e447 100644",
|
|
"--- a/ternary.rb",
|
|
"+++ b/ternary.rb",
|
|
"@@ -1,2 +1 @@",
|
|
"-condition ? case1 : case2",
|
|
" if condition then case 1 else case2"
|
|
],
|
|
"gitDir": "test/corpus/repos/ruby",
|
|
"shas": "7b67feda158a6c6ae27b09770dc435df1f5e8201..4b784cefa5912c61253dbbafc738a8786919ad7e"
|
|
}
|
|
,{
|
|
"testCaseDescription": "ruby-ternary-delete-rest-test",
|
|
"expectedResult": {
|
|
"changes": {},
|
|
"errors": {
|
|
"ternary.rb": [
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
2,
|
|
1
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'if condition then case 1 else case2\n' at line 1, column 1 - line 2, column 1"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"filePaths": [
|
|
"ternary.rb"
|
|
],
|
|
"patch": [
|
|
"diff --git a/ternary.rb b/ternary.rb",
|
|
"index f53e447..e69de29 100644",
|
|
"--- a/ternary.rb",
|
|
"+++ b/ternary.rb",
|
|
"@@ -1 +0,0 @@",
|
|
"-if condition then case 1 else case2"
|
|
],
|
|
"gitDir": "test/corpus/repos/ruby",
|
|
"shas": "4b784cefa5912c61253dbbafc738a8786919ad7e..431277d98db3b1763f33f0ad74712c0605d7f610"
|
|
}]
|