1
1
mirror of https://github.com/github/semantic.git synced 2025-01-03 04:51:57 +03:00

Fully test case/when/else

This commit is contained in:
Timothy Clem 2016-11-02 13:46:33 -07:00
parent fbe7bc7c13
commit 2e4c4ee194
4 changed files with 535 additions and 1 deletions

View File

@ -0,0 +1,262 @@
[{
"testCaseDescription": "ruby-case-when-else-insert-test",
"expectedResult": {
"changes": {
"case-when-else.rb": [
{
"span": {
"insert": {
"start": [
1,
1
],
"end": [
4,
4
]
}
},
"summary": "Added the 'foo' case statement"
}
]
},
"errors": {}
},
"filePaths": [
"case-when-else.rb"
],
"sha1": "7b88300c1604ec1f6e775ac48ea3f43087545738",
"gitDir": "test/corpus/repos/ruby",
"sha2": "cba20046e29c4a43a6a2f7a20fbe71372ea2f485"
}
,{
"testCaseDescription": "ruby-case-when-else-replacement-insert-test",
"expectedResult": {
"changes": {
"case-when-else.rb": [
{
"span": {
"insert": {
"start": [
1,
1
],
"end": [
6,
4
]
}
},
"summary": "Added the 'foo' case statement"
},
{
"span": {
"insert": {
"start": [
7,
1
],
"end": [
10,
4
]
}
},
"summary": "Added the 'foo' case statement"
}
]
},
"errors": {}
},
"filePaths": [
"case-when-else.rb"
],
"sha1": "cba20046e29c4a43a6a2f7a20fbe71372ea2f485",
"gitDir": "test/corpus/repos/ruby",
"sha2": "31387a19632065bd797ebae9c680b375b46e72a4"
}
,{
"testCaseDescription": "ruby-case-when-else-delete-insert-test",
"expectedResult": {
"changes": {
"case-when-else.rb": [
{
"span": {
"delete": {
"start": [
4,
1
],
"end": [
6,
1
]
}
},
"summary": "Deleted an else block in a case statement"
}
]
},
"errors": {}
},
"filePaths": [
"case-when-else.rb"
],
"sha1": "31387a19632065bd797ebae9c680b375b46e72a4",
"gitDir": "test/corpus/repos/ruby",
"sha2": "299fdb0e06b8397dc6fe2ba240ba90134d006a07"
}
,{
"testCaseDescription": "ruby-case-when-else-replacement-test",
"expectedResult": {
"changes": {
"case-when-else.rb": [
{
"span": {
"insert": {
"start": [
4,
1
],
"end": [
6,
1
]
}
},
"summary": "Added an else block in a case statement"
}
]
},
"errors": {}
},
"filePaths": [
"case-when-else.rb"
],
"sha1": "299fdb0e06b8397dc6fe2ba240ba90134d006a07",
"gitDir": "test/corpus/repos/ruby",
"sha2": "d1c0e2fa239eae1685645481516402d0219bc59e"
}
,{
"testCaseDescription": "ruby-case-when-else-delete-replacement-test",
"expectedResult": {
"changes": {
"case-when-else.rb": [
{
"span": {
"delete": {
"start": [
1,
1
],
"end": [
6,
4
]
}
},
"summary": "Deleted the 'foo' case statement"
},
{
"span": {
"delete": {
"start": [
7,
1
],
"end": [
10,
4
]
}
},
"summary": "Deleted the 'foo' case statement"
},
{
"span": {
"insert": {
"start": [
5,
1
],
"end": [
10,
4
]
}
},
"summary": "Added the 'foo' case statement"
}
]
},
"errors": {}
},
"filePaths": [
"case-when-else.rb"
],
"sha1": "d1c0e2fa239eae1685645481516402d0219bc59e",
"gitDir": "test/corpus/repos/ruby",
"sha2": "df3f41005b7a453a3eaf77ef4192a25bfa8aee5a"
}
,{
"testCaseDescription": "ruby-case-when-else-delete-test",
"expectedResult": {
"changes": {
"case-when-else.rb": [
{
"span": {
"delete": {
"start": [
1,
1
],
"end": [
4,
4
]
}
},
"summary": "Deleted the 'foo' case statement"
}
]
},
"errors": {}
},
"filePaths": [
"case-when-else.rb"
],
"sha1": "df3f41005b7a453a3eaf77ef4192a25bfa8aee5a",
"gitDir": "test/corpus/repos/ruby",
"sha2": "65383838c56a79f86304217a71799ce62d24e416"
}
,{
"testCaseDescription": "ruby-case-when-else-delete-rest-test",
"expectedResult": {
"changes": {
"case-when-else.rb": [
{
"span": {
"delete": {
"start": [
1,
1
],
"end": [
6,
4
]
}
},
"summary": "Deleted the 'foo' case statement"
}
]
},
"errors": {}
},
"filePaths": [
"case-when-else.rb"
],
"sha1": "65383838c56a79f86304217a71799ce62d24e416",
"gitDir": "test/corpus/repos/ruby",
"sha2": "f7e62e18ec0e13cd8261dee63a3b1559d6c5c8cd"
}]

View File

@ -0,0 +1,262 @@
[{
"testCaseDescription": "ruby-when-else-insert-test",
"expectedResult": {
"changes": {
"when-else.rb": [
{
"span": {
"insert": {
"start": [
1,
1
],
"end": [
5,
4
]
}
},
"summary": "Added the 'foo' case statement"
}
]
},
"errors": {}
},
"filePaths": [
"when-else.rb"
],
"sha1": "ec3951c0b3dd8098f16e44db974fe0ae9f54e68e",
"gitDir": "test/corpus/repos/ruby",
"sha2": "3e9490a17aa7b8de8f1b9da8f16936d00f02f3d0"
}
,{
"testCaseDescription": "ruby-when-else-replacement-insert-test",
"expectedResult": {
"changes": {
"when-else.rb": [
{
"span": {
"insert": {
"start": [
1,
1
],
"end": [
6,
4
]
}
},
"summary": "Added the 'foo' case statement"
},
{
"span": {
"insert": {
"start": [
7,
1
],
"end": [
11,
4
]
}
},
"summary": "Added the 'foo' case statement"
}
]
},
"errors": {}
},
"filePaths": [
"when-else.rb"
],
"sha1": "3e9490a17aa7b8de8f1b9da8f16936d00f02f3d0",
"gitDir": "test/corpus/repos/ruby",
"sha2": "6a55992ed83a22acee690724fb27c7602dc203d0"
}
,{
"testCaseDescription": "ruby-when-else-delete-insert-test",
"expectedResult": {
"changes": {
"when-else.rb": [
{
"span": {
"delete": {
"start": [
5,
2
],
"end": [
5,
5
]
}
},
"summary": "Deleted the 'qoz' identifier in an else block"
}
]
},
"errors": {}
},
"filePaths": [
"when-else.rb"
],
"sha1": "6a55992ed83a22acee690724fb27c7602dc203d0",
"gitDir": "test/corpus/repos/ruby",
"sha2": "eb050325465809da02f9eac02d5f0fd58a34e98d"
}
,{
"testCaseDescription": "ruby-when-else-replacement-test",
"expectedResult": {
"changes": {
"when-else.rb": [
{
"span": {
"insert": {
"start": [
5,
2
],
"end": [
5,
5
]
}
},
"summary": "Added the 'qoz' identifier in an else block"
}
]
},
"errors": {}
},
"filePaths": [
"when-else.rb"
],
"sha1": "eb050325465809da02f9eac02d5f0fd58a34e98d",
"gitDir": "test/corpus/repos/ruby",
"sha2": "2f9667691df40fd129950ae96d504cc9e4a07115"
}
,{
"testCaseDescription": "ruby-when-else-delete-replacement-test",
"expectedResult": {
"changes": {
"when-else.rb": [
{
"span": {
"delete": {
"start": [
1,
1
],
"end": [
6,
4
]
}
},
"summary": "Deleted the 'foo' case statement"
},
{
"span": {
"delete": {
"start": [
7,
1
],
"end": [
11,
4
]
}
},
"summary": "Deleted the 'foo' case statement"
},
{
"span": {
"insert": {
"start": [
6,
1
],
"end": [
11,
4
]
}
},
"summary": "Added the 'foo' case statement"
}
]
},
"errors": {}
},
"filePaths": [
"when-else.rb"
],
"sha1": "2f9667691df40fd129950ae96d504cc9e4a07115",
"gitDir": "test/corpus/repos/ruby",
"sha2": "5ddb7b05815111c5f855a8483602e5ed84d7807d"
}
,{
"testCaseDescription": "ruby-when-else-delete-test",
"expectedResult": {
"changes": {
"when-else.rb": [
{
"span": {
"delete": {
"start": [
1,
1
],
"end": [
5,
4
]
}
},
"summary": "Deleted the 'foo' case statement"
}
]
},
"errors": {}
},
"filePaths": [
"when-else.rb"
],
"sha1": "5ddb7b05815111c5f855a8483602e5ed84d7807d",
"gitDir": "test/corpus/repos/ruby",
"sha2": "356a3074b52bae43df83b49366184868aac4ad88"
}
,{
"testCaseDescription": "ruby-when-else-delete-rest-test",
"expectedResult": {
"changes": {
"when-else.rb": [
{
"span": {
"delete": {
"start": [
1,
1
],
"end": [
6,
4
]
}
},
"summary": "Deleted the 'foo' case statement"
}
]
},
"errors": {}
},
"filePaths": [
"when-else.rb"
],
"sha1": "356a3074b52bae43df83b49366184868aac4ad88",
"gitDir": "test/corpus/repos/ruby",
"sha2": "bfca7e21e4be7154bd72a73c426c00bc2596eddc"
}]

View File

@ -238,6 +238,16 @@
"syntax": "when",
"insert": "case foo\nwhen bar\nend",
"replacement": "case foo\nwhen bar\n baz\nend"
},
{
"syntax": "case-when-else",
"insert": "case foo\nwhen bar\n baz\nend",
"replacement": "case foo\nwhen bar\n baz\nelse\n qoz\nend"
},
{
"syntax": "when-else",
"insert": "case foo\nwhen bar\n baz\nelse\nend",
"replacement": "case foo\nwhen bar\n baz\nelse\n qoz\nend"
}
]
}

@ -1 +1 @@
Subproject commit ff122969324986ab2efa865790c05098cf5bf7eb
Subproject commit bfca7e21e4be7154bd72a73c426c00bc2596eddc