1
1
mirror of https://github.com/github/semantic.git synced 2024-12-01 00:33:59 +03:00

Move toc spec fixtures

This commit is contained in:
Timothy Clem 2017-02-22 17:22:50 -08:00
parent 38756dba85
commit a0ac9832a8
19 changed files with 1 additions and 2079 deletions

View File

@ -171,7 +171,7 @@ testDiff sourceBlobs = do
blobsForPaths :: Both FilePath -> IO (Both SourceBlob)
blobsForPaths paths = do
sources <- mapM (readAndTranscodeFile . ("test/corpus/toc/" <>)) paths
sources <- mapM (readAndTranscodeFile . ("test/fixtures/toc/" <>)) paths
pure $ SourceBlob <$> sources <*> pure mempty <*> paths <*> pure (Just Source.defaultPlainBlob)
sourceSpanBetween :: (Int, Int) -> (Int, Int) -> SourceSpan

File diff suppressed because it is too large Load Diff

View File

@ -1,383 +0,0 @@
[{
"testCaseDescription": "ruby-multiple-assignments-insert-test",
"expectedResult": {
"changes": {
"multiple-assignments.rb": [
{
"span": {
"insert": {
"start": [
1,
1
],
"end": [
1,
23
]
}
},
"summary": "Added the 'identifier' assignment"
}
]
},
"errors": {}
},
"filePaths": [
"multiple-assignments.rb"
],
"patch": [
"diff --git a/multiple-assignments.rb b/multiple-assignments.rb",
"index e69de29..348cf74 100644",
"--- a/multiple-assignments.rb",
"+++ b/multiple-assignments.rb",
"@@ -0,0 +1 @@",
"+x, y, z = [10, 20, 30]"
],
"gitDir": "test/corpus/repos/ruby",
"shas": "a966f9b2783f127617cc42cbed16e6ec570b75ad..850232b2802cc99838c38bb6884e78c8675d900d"
}
,{
"testCaseDescription": "ruby-multiple-assignments-replacement-insert-test",
"expectedResult": {
"changes": {
"multiple-assignments.rb": [
{
"span": {
"insert": {
"start": [
1,
1
],
"end": [
1,
21
]
}
},
"summary": "Added the 'identifier' assignment"
},
{
"span": {
"insert": {
"start": [
2,
1
],
"end": [
2,
23
]
}
},
"summary": "Added the 'identifier' assignment"
}
]
},
"errors": {}
},
"filePaths": [
"multiple-assignments.rb"
],
"patch": [
"diff --git a/multiple-assignments.rb b/multiple-assignments.rb",
"index 348cf74..242315a 100644",
"--- a/multiple-assignments.rb",
"+++ b/multiple-assignments.rb",
"@@ -1 +1,3 @@",
"+x, *y = [10, 20, 30]",
"+x, y, z = [10, 20, 30]",
" x, y, z = [10, 20, 30]"
],
"gitDir": "test/corpus/repos/ruby",
"shas": "850232b2802cc99838c38bb6884e78c8675d900d..2f0556416a97d736bf681a377c0a17ad20fe03a1"
}
,{
"testCaseDescription": "ruby-multiple-assignments-delete-insert-test",
"expectedResult": {
"changes": {
"multiple-assignments.rb": [
{
"span": {
"insert": {
"start": [
1,
4
],
"end": [
1,
5
]
}
},
"summary": "Added the 'y' identifier in an assignment to identifier"
},
{
"span": {
"insert": {
"start": [
1,
7
],
"end": [
1,
8
]
}
},
"summary": "Added the 'z' identifier in an assignment to identifier"
},
{
"span": {
"delete": {
"start": [
1,
5
],
"end": [
1,
6
]
}
},
"summary": "Deleted the 'y' identifier in an assignment to identifier"
}
]
},
"errors": {}
},
"filePaths": [
"multiple-assignments.rb"
],
"patch": [
"diff --git a/multiple-assignments.rb b/multiple-assignments.rb",
"index 242315a..274faf2 100644",
"--- a/multiple-assignments.rb",
"+++ b/multiple-assignments.rb",
"@@ -1,3 +1,3 @@",
"-x, *y = [10, 20, 30]",
"+x, y, z = [10, 20, 30]",
" x, y, z = [10, 20, 30]",
" x, y, z = [10, 20, 30]"
],
"gitDir": "test/corpus/repos/ruby",
"shas": "2f0556416a97d736bf681a377c0a17ad20fe03a1..4cf32e342e860dec68b496ba04ed8fca1d04a08f"
}
,{
"testCaseDescription": "ruby-multiple-assignments-replacement-test",
"expectedResult": {
"changes": {
"multiple-assignments.rb": [
{
"span": {
"insert": {
"start": [
1,
5
],
"end": [
1,
6
]
}
},
"summary": "Added the 'y' identifier in an assignment to identifier"
},
{
"span": {
"delete": {
"start": [
1,
4
],
"end": [
1,
5
]
}
},
"summary": "Deleted the 'y' identifier in an assignment to identifier"
},
{
"span": {
"delete": {
"start": [
1,
7
],
"end": [
1,
8
]
}
},
"summary": "Deleted the 'z' identifier in an assignment to identifier"
}
]
},
"errors": {}
},
"filePaths": [
"multiple-assignments.rb"
],
"patch": [
"diff --git a/multiple-assignments.rb b/multiple-assignments.rb",
"index 274faf2..242315a 100644",
"--- a/multiple-assignments.rb",
"+++ b/multiple-assignments.rb",
"@@ -1,3 +1,3 @@",
"-x, y, z = [10, 20, 30]",
"+x, *y = [10, 20, 30]",
" x, y, z = [10, 20, 30]",
" x, y, z = [10, 20, 30]"
],
"gitDir": "test/corpus/repos/ruby",
"shas": "4cf32e342e860dec68b496ba04ed8fca1d04a08f..3d3c3f2b1d6ed385e8c69eb0de5f5db36abd1f93"
}
,{
"testCaseDescription": "ruby-multiple-assignments-delete-replacement-test",
"expectedResult": {
"changes": {
"multiple-assignments.rb": [
{
"span": {
"delete": {
"start": [
1,
1
],
"end": [
1,
21
]
}
},
"summary": "Deleted the 'identifier' assignment"
},
{
"span": {
"delete": {
"start": [
2,
1
],
"end": [
2,
23
]
}
},
"summary": "Deleted the 'identifier' assignment"
},
{
"span": {
"insert": {
"start": [
2,
1
],
"end": [
2,
21
]
}
},
"summary": "Added the 'identifier' assignment"
}
]
},
"errors": {}
},
"filePaths": [
"multiple-assignments.rb"
],
"patch": [
"diff --git a/multiple-assignments.rb b/multiple-assignments.rb",
"index 242315a..7ba9487 100644",
"--- a/multiple-assignments.rb",
"+++ b/multiple-assignments.rb",
"@@ -1,3 +1,2 @@",
"-x, *y = [10, 20, 30]",
"-x, y, z = [10, 20, 30]",
" x, y, z = [10, 20, 30]",
"+x, *y = [10, 20, 30]"
],
"gitDir": "test/corpus/repos/ruby",
"shas": "3d3c3f2b1d6ed385e8c69eb0de5f5db36abd1f93..b724179373843cb5f953b1eb84fe3cf1f787cae1"
}
,{
"testCaseDescription": "ruby-multiple-assignments-delete-test",
"expectedResult": {
"changes": {
"multiple-assignments.rb": [
{
"span": {
"delete": {
"start": [
1,
1
],
"end": [
1,
23
]
}
},
"summary": "Deleted the 'identifier' assignment"
}
]
},
"errors": {}
},
"filePaths": [
"multiple-assignments.rb"
],
"patch": [
"diff --git a/multiple-assignments.rb b/multiple-assignments.rb",
"index 7ba9487..32cf6a2 100644",
"--- a/multiple-assignments.rb",
"+++ b/multiple-assignments.rb",
"@@ -1,2 +1 @@",
"-x, y, z = [10, 20, 30]",
" x, *y = [10, 20, 30]"
],
"gitDir": "test/corpus/repos/ruby",
"shas": "b724179373843cb5f953b1eb84fe3cf1f787cae1..9470930d6fca5e33ec313863fbe1c443d7388dbe"
}
,{
"testCaseDescription": "ruby-multiple-assignments-delete-rest-test",
"expectedResult": {
"changes": {
"multiple-assignments.rb": [
{
"span": {
"delete": {
"start": [
1,
1
],
"end": [
1,
21
]
}
},
"summary": "Deleted the 'identifier' assignment"
}
]
},
"errors": {}
},
"filePaths": [
"multiple-assignments.rb"
],
"patch": [
"diff --git a/multiple-assignments.rb b/multiple-assignments.rb",
"index 32cf6a2..e69de29 100644",
"--- a/multiple-assignments.rb",
"+++ b/multiple-assignments.rb",
"@@ -1 +0,0 @@",
"-x, *y = [10, 20, 30]"
],
"gitDir": "test/corpus/repos/ruby",
"shas": "9470930d6fca5e33ec313863fbe1c443d7388dbe..d4996909ad6798a66c5242d7171125ce6dbe1a50"
}]

View File

@ -1,383 +0,0 @@
[{
"testCaseDescription": "ruby-regex-insert-test",
"expectedResult": {
"changes": {
"regex.rb": [
{
"span": {
"insert": {
"start": [
1,
1
],
"end": [
1,
19
]
}
},
"summary": "Added the '/^(foo|bar[^_])$/i' regex"
}
]
},
"errors": {}
},
"filePaths": [
"regex.rb"
],
"patch": [
"diff --git a/regex.rb b/regex.rb",
"index e69de29..02dce9d 100644",
"--- a/regex.rb",
"+++ b/regex.rb",
"@@ -0,0 +1 @@",
"+/^(foo|bar[^_])$/i"
],
"gitDir": "test/corpus/repos/ruby",
"shas": "956b136e24f76c977fefd27d5368ecd527f721ec..49cb17b4244d627bd084dab1c7248c48a3cdb7cc"
}
,{
"testCaseDescription": "ruby-regex-replacement-insert-test",
"expectedResult": {
"changes": {
"regex.rb": [
{
"span": {
"insert": {
"start": [
1,
1
],
"end": [
1,
6
]
}
},
"summary": "Added the '%r/a/' regex"
},
{
"span": {
"insert": {
"start": [
2,
1
],
"end": [
2,
10
]
}
},
"summary": "Added the '%r<a<b>c>' regex"
},
{
"span": {
"insert": {
"start": [
3,
1
],
"end": [
3,
19
]
}
},
"summary": "Added the '/^(foo|bar[^_])$/i' regex"
}
]
},
"errors": {}
},
"filePaths": [
"regex.rb"
],
"patch": [
"diff --git a/regex.rb b/regex.rb",
"index 02dce9d..c801d61 100644",
"--- a/regex.rb",
"+++ b/regex.rb",
"@@ -1 +1,4 @@",
"+%r/a/",
"+%r<a<b>c>",
"+/^(foo|bar[^_])$/i",
" /^(foo|bar[^_])$/i"
],
"gitDir": "test/corpus/repos/ruby",
"shas": "49cb17b4244d627bd084dab1c7248c48a3cdb7cc..a73a7605d28b1fe2b09ce87d8db7426ea6295610"
}
,{
"testCaseDescription": "ruby-regex-delete-insert-test",
"expectedResult": {
"changes": {
"regex.rb": [
{
"span": {
"replace": [
{
"start": [
1,
1
],
"end": [
1,
6
]
},
{
"start": [
1,
1
],
"end": [
1,
19
]
}
]
},
"summary": "Replaced the '%r/a/' regex with the '/^(foo|bar[^_])$/i' regex"
},
{
"span": {
"delete": {
"start": [
2,
1
],
"end": [
2,
10
]
}
},
"summary": "Deleted the '%r<a<b>c>' regex"
}
]
},
"errors": {}
},
"filePaths": [
"regex.rb"
],
"patch": [
"diff --git a/regex.rb b/regex.rb",
"index c801d61..42d4984 100644",
"--- a/regex.rb",
"+++ b/regex.rb",
"@@ -1,4 +1,3 @@",
"-%r/a/",
"-%r<a<b>c>",
"+/^(foo|bar[^_])$/i",
" /^(foo|bar[^_])$/i",
" /^(foo|bar[^_])$/i"
],
"gitDir": "test/corpus/repos/ruby",
"shas": "a73a7605d28b1fe2b09ce87d8db7426ea6295610..edcc26845e0ed493216f7b8ce1235e7a37ace55d"
}
,{
"testCaseDescription": "ruby-regex-replacement-test",
"expectedResult": {
"changes": {
"regex.rb": [
{
"span": {
"replace": [
{
"start": [
1,
1
],
"end": [
1,
19
]
},
{
"start": [
1,
1
],
"end": [
1,
6
]
}
]
},
"summary": "Replaced the '/^(foo|bar[^_])$/i' regex with the '%r/a/' regex"
},
{
"span": {
"insert": {
"start": [
2,
1
],
"end": [
2,
10
]
}
},
"summary": "Added the '%r<a<b>c>' regex"
}
]
},
"errors": {}
},
"filePaths": [
"regex.rb"
],
"patch": [
"diff --git a/regex.rb b/regex.rb",
"index 42d4984..c801d61 100644",
"--- a/regex.rb",
"+++ b/regex.rb",
"@@ -1,3 +1,4 @@",
"-/^(foo|bar[^_])$/i",
"+%r/a/",
"+%r<a<b>c>",
" /^(foo|bar[^_])$/i",
" /^(foo|bar[^_])$/i"
],
"gitDir": "test/corpus/repos/ruby",
"shas": "edcc26845e0ed493216f7b8ce1235e7a37ace55d..46655f4fd04784ed0fd995951c5f83018cc02d97"
}
,{
"testCaseDescription": "ruby-regex-delete-replacement-test",
"expectedResult": {
"changes": {
"regex.rb": [
{
"span": {
"delete": {
"start": [
4,
1
],
"end": [
4,
19
]
}
},
"summary": "Deleted the '/^(foo|bar[^_])$/i' regex"
}
]
},
"errors": {}
},
"filePaths": [
"regex.rb"
],
"patch": [
"diff --git a/regex.rb b/regex.rb",
"index c801d61..48e43a9 100644",
"--- a/regex.rb",
"+++ b/regex.rb",
"@@ -1,4 +1,3 @@",
"+/^(foo|bar[^_])$/i",
" %r/a/",
" %r<a<b>c>",
"-/^(foo|bar[^_])$/i",
"-/^(foo|bar[^_])$/i"
],
"gitDir": "test/corpus/repos/ruby",
"shas": "46655f4fd04784ed0fd995951c5f83018cc02d97..dd7c07f9f3797a03b8a34fbd1efdbc98b01d2e76"
}
,{
"testCaseDescription": "ruby-regex-delete-test",
"expectedResult": {
"changes": {
"regex.rb": [
{
"span": {
"delete": {
"start": [
1,
1
],
"end": [
1,
19
]
}
},
"summary": "Deleted the '/^(foo|bar[^_])$/i' regex"
}
]
},
"errors": {}
},
"filePaths": [
"regex.rb"
],
"patch": [
"diff --git a/regex.rb b/regex.rb",
"index 48e43a9..b23927a 100644",
"--- a/regex.rb",
"+++ b/regex.rb",
"@@ -1,3 +1,2 @@",
"-/^(foo|bar[^_])$/i",
" %r/a/",
" %r<a<b>c>"
],
"gitDir": "test/corpus/repos/ruby",
"shas": "dd7c07f9f3797a03b8a34fbd1efdbc98b01d2e76..a9ee657f847f069d80fe4f52e9b1fb3bf991f26f"
}
,{
"testCaseDescription": "ruby-regex-delete-rest-test",
"expectedResult": {
"changes": {
"regex.rb": [
{
"span": {
"delete": {
"start": [
1,
1
],
"end": [
1,
6
]
}
},
"summary": "Deleted the '%r/a/' regex"
},
{
"span": {
"delete": {
"start": [
2,
1
],
"end": [
2,
10
]
}
},
"summary": "Deleted the '%r<a<b>c>' regex"
}
]
},
"errors": {}
},
"filePaths": [
"regex.rb"
],
"patch": [
"diff --git a/regex.rb b/regex.rb",
"index b23927a..e69de29 100644",
"--- a/regex.rb",
"+++ b/regex.rb",
"@@ -1,2 +0,0 @@",
"-%r/a/",
"-%r<a<b>c>"
],
"gitDir": "test/corpus/repos/ruby",
"shas": "a9ee657f847f069d80fe4f52e9b1fb3bf991f26f..e8c4c9b4ba151237a0e88d5a650d34ee5a5a1b61"
}]