1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 22:31:36 +03:00
semantic/test/corpus/json/javascript/array.json
2016-11-01 10:03:25 -05:00

1624 lines
62 KiB
JSON

[{
"testCaseDescription": "javascript-array-insert-test",
"expectedResult": {
"rows": [
[
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "ExpressionStatements",
"children": [
{
"category": "ArrayLiteral",
"children": [
{
"category": "StringLiteral",
"range": [
2,
9
]
}
],
"range": [
0,
11
]
}
],
"range": [
0,
12
]
}
],
"patch": "insert",
"range": [
0,
13
]
}
],
"hasChanges": true,
"range": [
0,
13
],
"number": 1
}
],
[
{
"terms": [
{
"category": "Program",
"children": [],
"patch": "insert",
"range": [
13,
13
]
}
],
"hasChanges": true,
"range": [
13,
13
],
"number": 2
}
]
],
"paths": [
"array.js",
"array.js"
],
"oids": [
"e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
"333558251d9d75b2f92ea2e7b4fde10635ea326e"
]
},
"filePaths": [
"array.js"
],
"sha1": "db6b4b303663e111cb1c1f9a562a5716d898e1c1",
"gitDir": "test/corpus/repos/javascript",
"sha2": "d0dcd4a06233a771be5a335efc03520c29f88b3e"
}
,{
"testCaseDescription": "javascript-array-replacement-insert-test",
"expectedResult": {
"rows": [
[
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "ExpressionStatements",
"children": [
{
"category": "ArrayLiteral",
"children": [
{
"category": "StringLiteral",
"range": [
2,
9
]
},
{
"category": "StringLiteral",
"range": [
11,
18
]
}
],
"range": [
0,
20
]
}
],
"patch": "insert",
"range": [
0,
21
]
}
],
"range": [
0,
22
]
}
],
"hasChanges": true,
"range": [
0,
22
],
"number": 1
}
],
[
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "ExpressionStatements",
"children": [
{
"category": "ArrayLiteral",
"children": [
{
"category": "StringLiteral",
"range": [
24,
31
]
}
],
"range": [
22,
33
]
}
],
"patch": "insert",
"range": [
22,
34
]
}
],
"range": [
22,
35
]
}
],
"hasChanges": true,
"range": [
22,
35
],
"number": 2
}
],
[
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "ExpressionStatements",
"children": [
{
"category": "ArrayLiteral",
"children": [
{
"category": "StringLiteral",
"range": [
2,
9
]
}
],
"range": [
0,
11
]
}
],
"range": [
0,
12
]
}
],
"range": [
0,
13
]
}
],
"hasChanges": false,
"range": [
0,
13
],
"number": 1
},
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "ExpressionStatements",
"children": [
{
"category": "ArrayLiteral",
"children": [
{
"category": "StringLiteral",
"range": [
37,
44
]
}
],
"range": [
35,
46
]
}
],
"range": [
35,
47
]
}
],
"range": [
35,
48
]
}
],
"hasChanges": false,
"range": [
35,
48
],
"number": 3
}
],
[
{
"terms": [
{
"category": "Program",
"children": [],
"range": [
13,
13
]
}
],
"hasChanges": false,
"range": [
13,
13
],
"number": 2
},
{
"terms": [
{
"category": "Program",
"children": [],
"range": [
48,
48
]
}
],
"hasChanges": false,
"range": [
48,
48
],
"number": 4
}
]
],
"paths": [
"array.js",
"array.js"
],
"oids": [
"333558251d9d75b2f92ea2e7b4fde10635ea326e",
"cf37d7c11b4cd430324ccafe51e2437d6aefcd16"
]
},
"filePaths": [
"array.js"
],
"sha1": "d0dcd4a06233a771be5a335efc03520c29f88b3e",
"gitDir": "test/corpus/repos/javascript",
"sha2": "05bf511dfedf94538f45fc63b9e2de7db8ed297c"
}
,{
"testCaseDescription": "javascript-array-delete-insert-test",
"expectedResult": {
"rows": [
[
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "ExpressionStatements",
"children": [
{
"category": "ArrayLiteral",
"children": [
{
"category": "StringLiteral",
"range": [
2,
9
]
},
{
"category": "StringLiteral",
"patch": "delete",
"range": [
11,
18
]
}
],
"range": [
0,
20
]
}
],
"range": [
0,
21
]
}
],
"range": [
0,
22
]
}
],
"hasChanges": true,
"range": [
0,
22
],
"number": 1
},
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "ExpressionStatements",
"children": [
{
"category": "ArrayLiteral",
"children": [
{
"category": "StringLiteral",
"range": [
2,
9
]
}
],
"range": [
0,
11
]
}
],
"range": [
0,
12
]
}
],
"range": [
0,
13
]
}
],
"hasChanges": false,
"range": [
0,
13
],
"number": 1
}
],
[
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "ExpressionStatements",
"children": [
{
"category": "ArrayLiteral",
"children": [
{
"category": "StringLiteral",
"range": [
24,
31
]
}
],
"range": [
22,
33
]
}
],
"range": [
22,
34
]
}
],
"range": [
22,
35
]
}
],
"hasChanges": false,
"range": [
22,
35
],
"number": 2
},
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "ExpressionStatements",
"children": [
{
"category": "ArrayLiteral",
"children": [
{
"category": "StringLiteral",
"range": [
15,
22
]
}
],
"range": [
13,
24
]
}
],
"range": [
13,
25
]
}
],
"range": [
13,
26
]
}
],
"hasChanges": false,
"range": [
13,
26
],
"number": 2
}
],
[
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "ExpressionStatements",
"children": [
{
"category": "ArrayLiteral",
"children": [
{
"category": "StringLiteral",
"range": [
37,
44
]
}
],
"range": [
35,
46
]
}
],
"range": [
35,
47
]
}
],
"range": [
35,
48
]
}
],
"hasChanges": false,
"range": [
35,
48
],
"number": 3
},
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "ExpressionStatements",
"children": [
{
"category": "ArrayLiteral",
"children": [
{
"category": "StringLiteral",
"range": [
28,
35
]
}
],
"range": [
26,
37
]
}
],
"range": [
26,
38
]
}
],
"range": [
26,
39
]
}
],
"hasChanges": false,
"range": [
26,
39
],
"number": 3
}
],
[
{
"terms": [
{
"category": "Program",
"children": [],
"range": [
48,
48
]
}
],
"hasChanges": false,
"range": [
48,
48
],
"number": 4
},
{
"terms": [
{
"category": "Program",
"children": [],
"range": [
39,
39
]
}
],
"hasChanges": false,
"range": [
39,
39
],
"number": 4
}
]
],
"paths": [
"array.js",
"array.js"
],
"oids": [
"cf37d7c11b4cd430324ccafe51e2437d6aefcd16",
"c2cb17facc693eda29753be3fc0ba8df902d61a7"
]
},
"filePaths": [
"array.js"
],
"sha1": "05bf511dfedf94538f45fc63b9e2de7db8ed297c",
"gitDir": "test/corpus/repos/javascript",
"sha2": "75847910b2c2eb7186d8af16dfbbef379f6e013e"
}
,{
"testCaseDescription": "javascript-array-replacement-test",
"expectedResult": {
"rows": [
[
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "ExpressionStatements",
"children": [
{
"category": "ArrayLiteral",
"children": [
{
"category": "StringLiteral",
"range": [
2,
9
]
}
],
"range": [
0,
11
]
}
],
"range": [
0,
12
]
}
],
"range": [
0,
13
]
}
],
"hasChanges": false,
"range": [
0,
13
],
"number": 1
},
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "ExpressionStatements",
"children": [
{
"category": "ArrayLiteral",
"children": [
{
"category": "StringLiteral",
"range": [
2,
9
]
},
{
"category": "StringLiteral",
"patch": "insert",
"range": [
11,
18
]
}
],
"range": [
0,
20
]
}
],
"range": [
0,
21
]
}
],
"range": [
0,
22
]
}
],
"hasChanges": true,
"range": [
0,
22
],
"number": 1
}
],
[
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "ExpressionStatements",
"children": [
{
"category": "ArrayLiteral",
"children": [
{
"category": "StringLiteral",
"range": [
15,
22
]
}
],
"range": [
13,
24
]
}
],
"range": [
13,
25
]
}
],
"range": [
13,
26
]
}
],
"hasChanges": false,
"range": [
13,
26
],
"number": 2
},
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "ExpressionStatements",
"children": [
{
"category": "ArrayLiteral",
"children": [
{
"category": "StringLiteral",
"range": [
24,
31
]
}
],
"range": [
22,
33
]
}
],
"range": [
22,
34
]
}
],
"range": [
22,
35
]
}
],
"hasChanges": false,
"range": [
22,
35
],
"number": 2
}
],
[
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "ExpressionStatements",
"children": [
{
"category": "ArrayLiteral",
"children": [
{
"category": "StringLiteral",
"range": [
28,
35
]
}
],
"range": [
26,
37
]
}
],
"range": [
26,
38
]
}
],
"range": [
26,
39
]
}
],
"hasChanges": false,
"range": [
26,
39
],
"number": 3
},
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "ExpressionStatements",
"children": [
{
"category": "ArrayLiteral",
"children": [
{
"category": "StringLiteral",
"range": [
37,
44
]
}
],
"range": [
35,
46
]
}
],
"range": [
35,
47
]
}
],
"range": [
35,
48
]
}
],
"hasChanges": false,
"range": [
35,
48
],
"number": 3
}
],
[
{
"terms": [
{
"category": "Program",
"children": [],
"range": [
39,
39
]
}
],
"hasChanges": false,
"range": [
39,
39
],
"number": 4
},
{
"terms": [
{
"category": "Program",
"children": [],
"range": [
48,
48
]
}
],
"hasChanges": false,
"range": [
48,
48
],
"number": 4
}
]
],
"paths": [
"array.js",
"array.js"
],
"oids": [
"c2cb17facc693eda29753be3fc0ba8df902d61a7",
"cf37d7c11b4cd430324ccafe51e2437d6aefcd16"
]
},
"filePaths": [
"array.js"
],
"sha1": "75847910b2c2eb7186d8af16dfbbef379f6e013e",
"gitDir": "test/corpus/repos/javascript",
"sha2": "c75bf06fa3338527f87aec52a0383057be139abd"
}
,{
"testCaseDescription": "javascript-array-delete-replacement-test",
"expectedResult": {
"rows": [
[
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "ExpressionStatements",
"children": [
{
"category": "ArrayLiteral",
"children": [
{
"category": "StringLiteral",
"range": [
2,
9
]
},
{
"category": "StringLiteral",
"range": [
11,
18
]
}
],
"range": [
0,
20
]
}
],
"patch": "delete",
"range": [
0,
21
]
}
],
"range": [
0,
22
]
}
],
"hasChanges": true,
"range": [
0,
22
],
"number": 1
}
],
[
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "ExpressionStatements",
"children": [
{
"category": "ArrayLiteral",
"children": [
{
"category": "StringLiteral",
"range": [
24,
31
]
}
],
"range": [
22,
33
]
}
],
"patch": "delete",
"range": [
22,
34
]
}
],
"range": [
22,
35
]
}
],
"hasChanges": true,
"range": [
22,
35
],
"number": 2
}
],
[
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "ExpressionStatements",
"children": [
{
"category": "ArrayLiteral",
"children": [
{
"category": "StringLiteral",
"range": [
37,
44
]
}
],
"range": [
35,
46
]
}
],
"range": [
35,
47
]
}
],
"range": [
35,
48
]
}
],
"hasChanges": false,
"range": [
35,
48
],
"number": 3
},
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "ExpressionStatements",
"children": [
{
"category": "ArrayLiteral",
"children": [
{
"category": "StringLiteral",
"range": [
2,
9
]
}
],
"range": [
0,
11
]
}
],
"range": [
0,
12
]
}
],
"range": [
0,
13
]
}
],
"hasChanges": false,
"range": [
0,
13
],
"number": 1
}
],
[
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "ExpressionStatements",
"children": [
{
"category": "ArrayLiteral",
"children": [
{
"category": "StringLiteral",
"range": [
15,
22
]
},
{
"category": "StringLiteral",
"range": [
24,
31
]
}
],
"range": [
13,
33
]
}
],
"patch": "insert",
"range": [
13,
34
]
}
],
"range": [
13,
35
]
}
],
"hasChanges": true,
"range": [
13,
35
],
"number": 2
}
],
[
{
"terms": [
{
"category": "Program",
"children": [],
"range": [
48,
48
]
}
],
"hasChanges": false,
"range": [
48,
48
],
"number": 4
},
{
"terms": [
{
"category": "Program",
"children": [],
"range": [
35,
35
]
}
],
"hasChanges": false,
"range": [
35,
35
],
"number": 3
}
]
],
"paths": [
"array.js",
"array.js"
],
"oids": [
"cf37d7c11b4cd430324ccafe51e2437d6aefcd16",
"a4d92b81400cceb07a65847680515a0990b0f7d9"
]
},
"filePaths": [
"array.js"
],
"sha1": "c75bf06fa3338527f87aec52a0383057be139abd",
"gitDir": "test/corpus/repos/javascript",
"sha2": "8959b8b6d92c6e063ccbfa47cee10ad69819a98f"
}
,{
"testCaseDescription": "javascript-array-delete-test",
"expectedResult": {
"rows": [
[
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "ExpressionStatements",
"children": [
{
"category": "ArrayLiteral",
"children": [
{
"category": "StringLiteral",
"range": [
2,
9
]
}
],
"range": [
0,
11
]
}
],
"patch": "delete",
"range": [
0,
12
]
}
],
"range": [
0,
13
]
}
],
"hasChanges": true,
"range": [
0,
13
],
"number": 1
}
],
[
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "ExpressionStatements",
"children": [
{
"category": "ArrayLiteral",
"children": [
{
"category": "StringLiteral",
"range": [
15,
22
]
},
{
"category": "StringLiteral",
"range": [
24,
31
]
}
],
"range": [
13,
33
]
}
],
"range": [
13,
34
]
}
],
"range": [
13,
35
]
}
],
"hasChanges": false,
"range": [
13,
35
],
"number": 2
},
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "ExpressionStatements",
"children": [
{
"category": "ArrayLiteral",
"children": [
{
"category": "StringLiteral",
"range": [
2,
9
]
},
{
"category": "StringLiteral",
"range": [
11,
18
]
}
],
"range": [
0,
20
]
}
],
"range": [
0,
21
]
}
],
"range": [
0,
22
]
}
],
"hasChanges": false,
"range": [
0,
22
],
"number": 1
}
],
[
{
"terms": [
{
"category": "Program",
"children": [],
"range": [
35,
35
]
}
],
"hasChanges": false,
"range": [
35,
35
],
"number": 3
},
{
"terms": [
{
"category": "Program",
"children": [],
"range": [
22,
22
]
}
],
"hasChanges": false,
"range": [
22,
22
],
"number": 2
}
]
],
"paths": [
"array.js",
"array.js"
],
"oids": [
"a4d92b81400cceb07a65847680515a0990b0f7d9",
"7f2f50e64a7063f8d786726568e38e7ea72accc7"
]
},
"filePaths": [
"array.js"
],
"sha1": "8959b8b6d92c6e063ccbfa47cee10ad69819a98f",
"gitDir": "test/corpus/repos/javascript",
"sha2": "91931ff0402e23e6ae6deef4a16ef8228e7e7021"
}
,{
"testCaseDescription": "javascript-array-delete-rest-test",
"expectedResult": {
"rows": [
[
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "ExpressionStatements",
"children": [
{
"category": "ArrayLiteral",
"children": [
{
"category": "StringLiteral",
"range": [
2,
9
]
},
{
"category": "StringLiteral",
"range": [
11,
18
]
}
],
"range": [
0,
20
]
}
],
"range": [
0,
21
]
}
],
"patch": "delete",
"range": [
0,
22
]
}
],
"hasChanges": true,
"range": [
0,
22
],
"number": 1
}
],
[
{
"terms": [
{
"category": "Program",
"children": [],
"patch": "delete",
"range": [
22,
22
]
}
],
"hasChanges": true,
"range": [
22,
22
],
"number": 2
}
]
],
"paths": [
"array.js",
"array.js"
],
"oids": [
"7f2f50e64a7063f8d786726568e38e7ea72accc7",
"e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"
]
},
"filePaths": [
"array.js"
],
"sha1": "91931ff0402e23e6ae6deef4a16ef8228e7e7021",
"gitDir": "test/corpus/repos/javascript",
"sha2": "c64220acd06d1d07ebc6df15d54c3328fa9edecc"
}]