1
1
mirror of https://github.com/github/semantic.git synced 2024-12-23 06:41:45 +03:00
semantic/test/corpus/json/javascript/object.json
2016-11-01 10:03:25 -05:00

2354 lines
109 KiB
JSON

[{
"testCaseDescription": "javascript-object-insert-test",
"expectedResult": {
"rows": [
[
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "ExpressionStatements",
"children": [
{
"category": "Object",
"children": [
{
"category": "Pair",
"children": [
{
"category": "StringLiteral",
"range": [
2,
8
]
},
{
"category": "StringLiteral",
"range": [
10,
18
]
}
],
"range": [
2,
18
]
}
],
"range": [
0,
20
]
}
],
"range": [
0,
21
]
}
],
"patch": "insert",
"range": [
0,
22
]
}
],
"hasChanges": true,
"range": [
0,
22
],
"number": 1
}
],
[
{
"terms": [
{
"category": "Program",
"children": [],
"patch": "insert",
"range": [
22,
22
]
}
],
"hasChanges": true,
"range": [
22,
22
],
"number": 2
}
]
],
"paths": [
"object.js",
"object.js"
],
"oids": [
"e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
"fe17bb20d5e0ada03f8b771d45dcc2d553584145"
]
},
"filePaths": [
"object.js"
],
"sha1": "ddc540ac245ab0b5fd645525c53e4326f07dd253",
"gitDir": "test/corpus/repos/javascript",
"sha2": "02e493df252379d01f024ef30ffee5d933b2709e"
}
,{
"testCaseDescription": "javascript-object-replacement-insert-test",
"expectedResult": {
"rows": [
[
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "ExpressionStatements",
"children": [
{
"category": "Object",
"children": [
{
"category": "Pair",
"children": [
{
"category": "StringLiteral",
"range": [
2,
8
]
},
{
"category": "StringLiteral",
"range": [
10,
18
]
}
],
"range": [
2,
18
]
},
{
"category": "Pair",
"children": [
{
"category": "StringLiteral",
"range": [
20,
26
]
},
{
"category": "StringLiteral",
"range": [
28,
36
]
}
],
"range": [
20,
36
]
},
{
"category": "Pair",
"children": [
{
"category": "StringLiteral",
"range": [
38,
44
]
},
{
"category": "StringLiteral",
"range": [
46,
51
]
}
],
"range": [
38,
51
]
}
],
"range": [
0,
53
]
}
],
"patch": "insert",
"range": [
0,
54
]
}
],
"range": [
0,
55
]
}
],
"hasChanges": true,
"range": [
0,
55
],
"number": 1
}
],
[
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "ExpressionStatements",
"children": [
{
"category": "Object",
"children": [
{
"category": "Pair",
"children": [
{
"category": "StringLiteral",
"range": [
57,
63
]
},
{
"category": "StringLiteral",
"range": [
65,
73
]
}
],
"range": [
57,
73
]
}
],
"range": [
55,
75
]
}
],
"patch": "insert",
"range": [
55,
76
]
}
],
"range": [
55,
77
]
}
],
"hasChanges": true,
"range": [
55,
77
],
"number": 2
}
],
[
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "ExpressionStatements",
"children": [
{
"category": "Object",
"children": [
{
"category": "Pair",
"children": [
{
"category": "StringLiteral",
"range": [
2,
8
]
},
{
"category": "StringLiteral",
"range": [
10,
18
]
}
],
"range": [
2,
18
]
}
],
"range": [
0,
20
]
}
],
"range": [
0,
21
]
}
],
"range": [
0,
22
]
}
],
"hasChanges": false,
"range": [
0,
22
],
"number": 1
},
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "ExpressionStatements",
"children": [
{
"category": "Object",
"children": [
{
"category": "Pair",
"children": [
{
"category": "StringLiteral",
"range": [
79,
85
]
},
{
"category": "StringLiteral",
"range": [
87,
95
]
}
],
"range": [
79,
95
]
}
],
"range": [
77,
97
]
}
],
"range": [
77,
98
]
}
],
"range": [
77,
99
]
}
],
"hasChanges": false,
"range": [
77,
99
],
"number": 3
}
],
[
{
"terms": [
{
"category": "Program",
"children": [],
"range": [
22,
22
]
}
],
"hasChanges": false,
"range": [
22,
22
],
"number": 2
},
{
"terms": [
{
"category": "Program",
"children": [],
"range": [
99,
99
]
}
],
"hasChanges": false,
"range": [
99,
99
],
"number": 4
}
]
],
"paths": [
"object.js",
"object.js"
],
"oids": [
"fe17bb20d5e0ada03f8b771d45dcc2d553584145",
"741c3dc18ee0367453de24a06ac75106b0e303a2"
]
},
"filePaths": [
"object.js"
],
"sha1": "02e493df252379d01f024ef30ffee5d933b2709e",
"gitDir": "test/corpus/repos/javascript",
"sha2": "b8ef427988a562f7ee653554ae3376034aebfa25"
}
,{
"testCaseDescription": "javascript-object-delete-insert-test",
"expectedResult": {
"rows": [
[
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "ExpressionStatements",
"children": [
{
"category": "Object",
"children": [
{
"category": "Pair",
"children": [
{
"category": "StringLiteral",
"range": [
2,
8
]
},
{
"category": "StringLiteral",
"range": [
10,
18
]
}
],
"range": [
2,
18
]
},
{
"category": "Pair",
"children": [
{
"category": "StringLiteral",
"range": [
20,
26
]
},
{
"category": "StringLiteral",
"range": [
28,
36
]
}
],
"patch": "delete",
"range": [
20,
36
]
},
{
"category": "Pair",
"children": [
{
"category": "StringLiteral",
"range": [
38,
44
]
},
{
"category": "StringLiteral",
"range": [
46,
51
]
}
],
"patch": "delete",
"range": [
38,
51
]
}
],
"range": [
0,
53
]
}
],
"range": [
0,
54
]
}
],
"range": [
0,
55
]
}
],
"hasChanges": true,
"range": [
0,
55
],
"number": 1
},
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "ExpressionStatements",
"children": [
{
"category": "Object",
"children": [
{
"category": "Pair",
"children": [
{
"category": "StringLiteral",
"range": [
2,
8
]
},
{
"category": "StringLiteral",
"range": [
10,
18
]
}
],
"range": [
2,
18
]
}
],
"range": [
0,
20
]
}
],
"range": [
0,
21
]
}
],
"range": [
0,
22
]
}
],
"hasChanges": false,
"range": [
0,
22
],
"number": 1
}
],
[
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "ExpressionStatements",
"children": [
{
"category": "Object",
"children": [
{
"category": "Pair",
"children": [
{
"category": "StringLiteral",
"range": [
57,
63
]
},
{
"category": "StringLiteral",
"range": [
65,
73
]
}
],
"range": [
57,
73
]
}
],
"range": [
55,
75
]
}
],
"range": [
55,
76
]
}
],
"range": [
55,
77
]
}
],
"hasChanges": false,
"range": [
55,
77
],
"number": 2
},
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "ExpressionStatements",
"children": [
{
"category": "Object",
"children": [
{
"category": "Pair",
"children": [
{
"category": "StringLiteral",
"range": [
24,
30
]
},
{
"category": "StringLiteral",
"range": [
32,
40
]
}
],
"range": [
24,
40
]
}
],
"range": [
22,
42
]
}
],
"range": [
22,
43
]
}
],
"range": [
22,
44
]
}
],
"hasChanges": false,
"range": [
22,
44
],
"number": 2
}
],
[
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "ExpressionStatements",
"children": [
{
"category": "Object",
"children": [
{
"category": "Pair",
"children": [
{
"category": "StringLiteral",
"range": [
79,
85
]
},
{
"category": "StringLiteral",
"range": [
87,
95
]
}
],
"range": [
79,
95
]
}
],
"range": [
77,
97
]
}
],
"range": [
77,
98
]
}
],
"range": [
77,
99
]
}
],
"hasChanges": false,
"range": [
77,
99
],
"number": 3
},
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "ExpressionStatements",
"children": [
{
"category": "Object",
"children": [
{
"category": "Pair",
"children": [
{
"category": "StringLiteral",
"range": [
46,
52
]
},
{
"category": "StringLiteral",
"range": [
54,
62
]
}
],
"range": [
46,
62
]
}
],
"range": [
44,
64
]
}
],
"range": [
44,
65
]
}
],
"range": [
44,
66
]
}
],
"hasChanges": false,
"range": [
44,
66
],
"number": 3
}
],
[
{
"terms": [
{
"category": "Program",
"children": [],
"range": [
99,
99
]
}
],
"hasChanges": false,
"range": [
99,
99
],
"number": 4
},
{
"terms": [
{
"category": "Program",
"children": [],
"range": [
66,
66
]
}
],
"hasChanges": false,
"range": [
66,
66
],
"number": 4
}
]
],
"paths": [
"object.js",
"object.js"
],
"oids": [
"741c3dc18ee0367453de24a06ac75106b0e303a2",
"701239d4791062b1b1d6d512a409c2cbeae71cd0"
]
},
"filePaths": [
"object.js"
],
"sha1": "b8ef427988a562f7ee653554ae3376034aebfa25",
"gitDir": "test/corpus/repos/javascript",
"sha2": "3f2600f5c3dfb89186f9c3c0eae80909b61e0c84"
}
,{
"testCaseDescription": "javascript-object-replacement-test",
"expectedResult": {
"rows": [
[
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "ExpressionStatements",
"children": [
{
"category": "Object",
"children": [
{
"category": "Pair",
"children": [
{
"category": "StringLiteral",
"range": [
2,
8
]
},
{
"category": "StringLiteral",
"range": [
10,
18
]
}
],
"range": [
2,
18
]
}
],
"range": [
0,
20
]
}
],
"range": [
0,
21
]
}
],
"range": [
0,
22
]
}
],
"hasChanges": false,
"range": [
0,
22
],
"number": 1
},
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "ExpressionStatements",
"children": [
{
"category": "Object",
"children": [
{
"category": "Pair",
"children": [
{
"category": "StringLiteral",
"range": [
2,
8
]
},
{
"category": "StringLiteral",
"range": [
10,
18
]
}
],
"range": [
2,
18
]
},
{
"category": "Pair",
"children": [
{
"category": "StringLiteral",
"range": [
20,
26
]
},
{
"category": "StringLiteral",
"range": [
28,
36
]
}
],
"patch": "insert",
"range": [
20,
36
]
},
{
"category": "Pair",
"children": [
{
"category": "StringLiteral",
"range": [
38,
44
]
},
{
"category": "StringLiteral",
"range": [
46,
51
]
}
],
"patch": "insert",
"range": [
38,
51
]
}
],
"range": [
0,
53
]
}
],
"range": [
0,
54
]
}
],
"range": [
0,
55
]
}
],
"hasChanges": true,
"range": [
0,
55
],
"number": 1
}
],
[
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "ExpressionStatements",
"children": [
{
"category": "Object",
"children": [
{
"category": "Pair",
"children": [
{
"category": "StringLiteral",
"range": [
24,
30
]
},
{
"category": "StringLiteral",
"range": [
32,
40
]
}
],
"range": [
24,
40
]
}
],
"range": [
22,
42
]
}
],
"range": [
22,
43
]
}
],
"range": [
22,
44
]
}
],
"hasChanges": false,
"range": [
22,
44
],
"number": 2
},
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "ExpressionStatements",
"children": [
{
"category": "Object",
"children": [
{
"category": "Pair",
"children": [
{
"category": "StringLiteral",
"range": [
57,
63
]
},
{
"category": "StringLiteral",
"range": [
65,
73
]
}
],
"range": [
57,
73
]
}
],
"range": [
55,
75
]
}
],
"range": [
55,
76
]
}
],
"range": [
55,
77
]
}
],
"hasChanges": false,
"range": [
55,
77
],
"number": 2
}
],
[
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "ExpressionStatements",
"children": [
{
"category": "Object",
"children": [
{
"category": "Pair",
"children": [
{
"category": "StringLiteral",
"range": [
46,
52
]
},
{
"category": "StringLiteral",
"range": [
54,
62
]
}
],
"range": [
46,
62
]
}
],
"range": [
44,
64
]
}
],
"range": [
44,
65
]
}
],
"range": [
44,
66
]
}
],
"hasChanges": false,
"range": [
44,
66
],
"number": 3
},
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "ExpressionStatements",
"children": [
{
"category": "Object",
"children": [
{
"category": "Pair",
"children": [
{
"category": "StringLiteral",
"range": [
79,
85
]
},
{
"category": "StringLiteral",
"range": [
87,
95
]
}
],
"range": [
79,
95
]
}
],
"range": [
77,
97
]
}
],
"range": [
77,
98
]
}
],
"range": [
77,
99
]
}
],
"hasChanges": false,
"range": [
77,
99
],
"number": 3
}
],
[
{
"terms": [
{
"category": "Program",
"children": [],
"range": [
66,
66
]
}
],
"hasChanges": false,
"range": [
66,
66
],
"number": 4
},
{
"terms": [
{
"category": "Program",
"children": [],
"range": [
99,
99
]
}
],
"hasChanges": false,
"range": [
99,
99
],
"number": 4
}
]
],
"paths": [
"object.js",
"object.js"
],
"oids": [
"701239d4791062b1b1d6d512a409c2cbeae71cd0",
"741c3dc18ee0367453de24a06ac75106b0e303a2"
]
},
"filePaths": [
"object.js"
],
"sha1": "3f2600f5c3dfb89186f9c3c0eae80909b61e0c84",
"gitDir": "test/corpus/repos/javascript",
"sha2": "5f163ddff1fbf2a1c9c320e3ff1a9cf3335f3b20"
}
,{
"testCaseDescription": "javascript-object-delete-replacement-test",
"expectedResult": {
"rows": [
[
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "ExpressionStatements",
"children": [
{
"category": "Object",
"children": [
{
"category": "Pair",
"children": [
{
"category": "StringLiteral",
"range": [
2,
8
]
},
{
"category": "StringLiteral",
"range": [
10,
18
]
}
],
"range": [
2,
18
]
},
{
"category": "Pair",
"children": [
{
"category": "StringLiteral",
"range": [
20,
26
]
},
{
"category": "StringLiteral",
"range": [
28,
36
]
}
],
"range": [
20,
36
]
},
{
"category": "Pair",
"children": [
{
"category": "StringLiteral",
"range": [
38,
44
]
},
{
"category": "StringLiteral",
"range": [
46,
51
]
}
],
"range": [
38,
51
]
}
],
"range": [
0,
53
]
}
],
"patch": "delete",
"range": [
0,
54
]
}
],
"range": [
0,
55
]
}
],
"hasChanges": true,
"range": [
0,
55
],
"number": 1
}
],
[
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "ExpressionStatements",
"children": [
{
"category": "Object",
"children": [
{
"category": "Pair",
"children": [
{
"category": "StringLiteral",
"range": [
57,
63
]
},
{
"category": "StringLiteral",
"range": [
65,
73
]
}
],
"range": [
57,
73
]
}
],
"range": [
55,
75
]
}
],
"patch": "delete",
"range": [
55,
76
]
}
],
"range": [
55,
77
]
}
],
"hasChanges": true,
"range": [
55,
77
],
"number": 2
}
],
[
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "ExpressionStatements",
"children": [
{
"category": "Object",
"children": [
{
"category": "Pair",
"children": [
{
"category": "StringLiteral",
"range": [
79,
85
]
},
{
"category": "StringLiteral",
"range": [
87,
95
]
}
],
"range": [
79,
95
]
}
],
"range": [
77,
97
]
}
],
"range": [
77,
98
]
}
],
"range": [
77,
99
]
}
],
"hasChanges": false,
"range": [
77,
99
],
"number": 3
},
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "ExpressionStatements",
"children": [
{
"category": "Object",
"children": [
{
"category": "Pair",
"children": [
{
"category": "StringLiteral",
"range": [
2,
8
]
},
{
"category": "StringLiteral",
"range": [
10,
18
]
}
],
"range": [
2,
18
]
}
],
"range": [
0,
20
]
}
],
"range": [
0,
21
]
}
],
"range": [
0,
22
]
}
],
"hasChanges": false,
"range": [
0,
22
],
"number": 1
}
],
[
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "ExpressionStatements",
"children": [
{
"category": "Object",
"children": [
{
"category": "Pair",
"children": [
{
"category": "StringLiteral",
"range": [
24,
30
]
},
{
"category": "StringLiteral",
"range": [
32,
40
]
}
],
"range": [
24,
40
]
},
{
"category": "Pair",
"children": [
{
"category": "StringLiteral",
"range": [
42,
48
]
},
{
"category": "StringLiteral",
"range": [
50,
58
]
}
],
"range": [
42,
58
]
},
{
"category": "Pair",
"children": [
{
"category": "StringLiteral",
"range": [
60,
66
]
},
{
"category": "StringLiteral",
"range": [
68,
73
]
}
],
"range": [
60,
73
]
}
],
"range": [
22,
75
]
}
],
"patch": "insert",
"range": [
22,
76
]
}
],
"range": [
22,
77
]
}
],
"hasChanges": true,
"range": [
22,
77
],
"number": 2
}
],
[
{
"terms": [
{
"category": "Program",
"children": [],
"range": [
99,
99
]
}
],
"hasChanges": false,
"range": [
99,
99
],
"number": 4
},
{
"terms": [
{
"category": "Program",
"children": [],
"range": [
77,
77
]
}
],
"hasChanges": false,
"range": [
77,
77
],
"number": 3
}
]
],
"paths": [
"object.js",
"object.js"
],
"oids": [
"741c3dc18ee0367453de24a06ac75106b0e303a2",
"9e4827392b43125f3109e099c54540e927e83088"
]
},
"filePaths": [
"object.js"
],
"sha1": "5f163ddff1fbf2a1c9c320e3ff1a9cf3335f3b20",
"gitDir": "test/corpus/repos/javascript",
"sha2": "d2336b4014d99b5819a8b05ea66078310867e600"
}
,{
"testCaseDescription": "javascript-object-delete-test",
"expectedResult": {
"rows": [
[
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "ExpressionStatements",
"children": [
{
"category": "Object",
"children": [
{
"category": "Pair",
"children": [
{
"category": "StringLiteral",
"range": [
2,
8
]
},
{
"category": "StringLiteral",
"range": [
10,
18
]
}
],
"range": [
2,
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": "Object",
"children": [
{
"category": "Pair",
"children": [
{
"category": "StringLiteral",
"range": [
24,
30
]
},
{
"category": "StringLiteral",
"range": [
32,
40
]
}
],
"range": [
24,
40
]
},
{
"category": "Pair",
"children": [
{
"category": "StringLiteral",
"range": [
42,
48
]
},
{
"category": "StringLiteral",
"range": [
50,
58
]
}
],
"range": [
42,
58
]
},
{
"category": "Pair",
"children": [
{
"category": "StringLiteral",
"range": [
60,
66
]
},
{
"category": "StringLiteral",
"range": [
68,
73
]
}
],
"range": [
60,
73
]
}
],
"range": [
22,
75
]
}
],
"range": [
22,
76
]
}
],
"range": [
22,
77
]
}
],
"hasChanges": false,
"range": [
22,
77
],
"number": 2
},
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "ExpressionStatements",
"children": [
{
"category": "Object",
"children": [
{
"category": "Pair",
"children": [
{
"category": "StringLiteral",
"range": [
2,
8
]
},
{
"category": "StringLiteral",
"range": [
10,
18
]
}
],
"range": [
2,
18
]
},
{
"category": "Pair",
"children": [
{
"category": "StringLiteral",
"range": [
20,
26
]
},
{
"category": "StringLiteral",
"range": [
28,
36
]
}
],
"range": [
20,
36
]
},
{
"category": "Pair",
"children": [
{
"category": "StringLiteral",
"range": [
38,
44
]
},
{
"category": "StringLiteral",
"range": [
46,
51
]
}
],
"range": [
38,
51
]
}
],
"range": [
0,
53
]
}
],
"range": [
0,
54
]
}
],
"range": [
0,
55
]
}
],
"hasChanges": false,
"range": [
0,
55
],
"number": 1
}
],
[
{
"terms": [
{
"category": "Program",
"children": [],
"range": [
77,
77
]
}
],
"hasChanges": false,
"range": [
77,
77
],
"number": 3
},
{
"terms": [
{
"category": "Program",
"children": [],
"range": [
55,
55
]
}
],
"hasChanges": false,
"range": [
55,
55
],
"number": 2
}
]
],
"paths": [
"object.js",
"object.js"
],
"oids": [
"9e4827392b43125f3109e099c54540e927e83088",
"12d063ad120ecce823ab0d7a5bce83c59a522751"
]
},
"filePaths": [
"object.js"
],
"sha1": "d2336b4014d99b5819a8b05ea66078310867e600",
"gitDir": "test/corpus/repos/javascript",
"sha2": "951089709afd2be1acaca07d88e576f5eb181d28"
}
,{
"testCaseDescription": "javascript-object-delete-rest-test",
"expectedResult": {
"rows": [
[
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "ExpressionStatements",
"children": [
{
"category": "Object",
"children": [
{
"category": "Pair",
"children": [
{
"category": "StringLiteral",
"range": [
2,
8
]
},
{
"category": "StringLiteral",
"range": [
10,
18
]
}
],
"range": [
2,
18
]
},
{
"category": "Pair",
"children": [
{
"category": "StringLiteral",
"range": [
20,
26
]
},
{
"category": "StringLiteral",
"range": [
28,
36
]
}
],
"range": [
20,
36
]
},
{
"category": "Pair",
"children": [
{
"category": "StringLiteral",
"range": [
38,
44
]
},
{
"category": "StringLiteral",
"range": [
46,
51
]
}
],
"range": [
38,
51
]
}
],
"range": [
0,
53
]
}
],
"range": [
0,
54
]
}
],
"patch": "delete",
"range": [
0,
55
]
}
],
"hasChanges": true,
"range": [
0,
55
],
"number": 1
}
],
[
{
"terms": [
{
"category": "Program",
"children": [],
"patch": "delete",
"range": [
55,
55
]
}
],
"hasChanges": true,
"range": [
55,
55
],
"number": 2
}
]
],
"paths": [
"object.js",
"object.js"
],
"oids": [
"12d063ad120ecce823ab0d7a5bce83c59a522751",
"e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"
]
},
"filePaths": [
"object.js"
],
"sha1": "951089709afd2be1acaca07d88e576f5eb181d28",
"gitDir": "test/corpus/repos/javascript",
"sha2": "56f451956d623f7bbf419f7ccf5256129744c435"
}]