mirror of
https://github.com/github/semantic.git
synced 2024-12-26 00:12:29 +03:00
456 lines
14 KiB
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": "d4fc8a027c6aed02fc334b6c05f11b1ce29f473d..24c50c7e6e397f1fdabdad11244cb28a8bb6b124"
|
|
}
|
|
,{
|
|
"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": "24c50c7e6e397f1fdabdad11244cb28a8bb6b124..6b0808afc513fe17d7ac9d5b222c1e935cbd058b"
|
|
}
|
|
,{
|
|
"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": "6b0808afc513fe17d7ac9d5b222c1e935cbd058b..681c9ae4b39b202ad7f57a38e813e908c3a5e4c1"
|
|
}
|
|
,{
|
|
"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": "681c9ae4b39b202ad7f57a38e813e908c3a5e4c1..7ddb733871529235c4084e8b8382b40f8b9bf221"
|
|
}
|
|
,{
|
|
"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": "7ddb733871529235c4084e8b8382b40f8b9bf221..8937f453342377c208809d6d67e9fcfd434f9ae6"
|
|
}
|
|
,{
|
|
"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": "8937f453342377c208809d6d67e9fcfd434f9ae6..3fce43264348c2d3e1ee2a77e57f1c74ab2f4553"
|
|
}
|
|
,{
|
|
"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": "3fce43264348c2d3e1ee2a77e57f1c74ab2f4553..ce04b2e8cbe7f782390964cdc6806c789ad762e0"
|
|
}]
|