1
1
mirror of https://github.com/github/semantic.git synced 2024-12-23 06:41:45 +03:00
semantic/test/corpus/json/javascript/var-declaration.json

2256 lines
100 KiB
JSON
Raw Normal View History

[{
"testCaseDescription": "javascript-var-declaration-insert-test",
"expectedResult": {
"rows": [
[
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "VarAssignment",
"children": [
{
"category": "Identifier",
"range": [
4,
5
]
},
{
"category": "NumberLiteral",
"range": [
8,
9
]
}
],
"range": [
4,
9
]
}
],
"range": [
4,
9
]
}
],
"range": [
0,
10
]
}
],
"patch": "insert",
"range": [
0,
11
]
}
],
"hasChanges": true,
"range": [
0,
11
],
"number": 1
}
],
[
{
"terms": [
{
"category": "Program",
"children": [],
"patch": "insert",
"range": [
11,
11
]
}
],
"hasChanges": true,
"range": [
11,
11
],
"number": 2
}
]
],
"paths": [
"var-declaration.js",
"var-declaration.js"
],
"oids": [
"e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
"b506100a909fbf6e4369c496c17b688d66f72fca"
]
},
"filePaths": [
"var-declaration.js"
],
"sha1": "580b6e349db9b7481da742852edf5c2193d23599",
"gitDir": "test/corpus/repos/javascript",
"sha2": "dd7a30cf841411746e9c2cdb8223b4c66651674a"
}
,{
"testCaseDescription": "javascript-var-declaration-replacement-insert-test",
"expectedResult": {
"rows": [
[
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "Identifier",
"range": [
4,
5
]
}
],
"range": [
4,
5
]
},
{
"category": "VarDecl",
"children": [
{
"category": "VarAssignment",
"children": [
{
"category": "Identifier",
"range": [
7,
8
]
},
{
"category": "Object",
"children": [],
"range": [
11,
13
]
}
],
"range": [
7,
13
]
}
],
"range": [
7,
13
]
},
{
"category": "VarDecl",
"children": [
{
"category": "Identifier",
"range": [
15,
16
]
}
],
"range": [
15,
16
]
}
],
"patch": "insert",
"range": [
0,
17
]
}
],
"range": [
0,
18
]
}
],
"hasChanges": true,
"range": [
0,
18
],
"number": 1
}
],
[
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "VarAssignment",
"children": [
{
"category": "Identifier",
"range": [
22,
23
]
},
{
"category": "NumberLiteral",
"range": [
26,
27
]
}
],
"range": [
22,
27
]
}
],
"range": [
22,
27
]
}
],
"patch": "insert",
"range": [
18,
28
]
}
],
"range": [
18,
29
]
}
],
"hasChanges": true,
"range": [
18,
29
],
"number": 2
}
],
[
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "VarAssignment",
"children": [
{
"category": "Identifier",
"range": [
4,
5
]
},
{
"category": "NumberLiteral",
"range": [
8,
9
]
}
],
"range": [
4,
9
]
}
],
"range": [
4,
9
]
}
],
"range": [
0,
10
]
}
],
"range": [
0,
11
]
}
],
"hasChanges": false,
"range": [
0,
11
],
"number": 1
},
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "VarAssignment",
"children": [
{
"category": "Identifier",
"range": [
33,
34
]
},
{
"category": "NumberLiteral",
"range": [
37,
38
]
}
],
"range": [
33,
38
]
}
],
"range": [
33,
38
]
}
],
"range": [
29,
39
]
}
],
"range": [
29,
40
]
}
],
"hasChanges": false,
"range": [
29,
40
],
"number": 3
}
],
[
{
"terms": [
{
"category": "Program",
"children": [],
"range": [
11,
11
]
}
],
"hasChanges": false,
"range": [
11,
11
],
"number": 2
},
{
"terms": [
{
"category": "Program",
"children": [],
"range": [
40,
40
]
}
],
"hasChanges": false,
"range": [
40,
40
],
"number": 4
}
]
],
"paths": [
"var-declaration.js",
"var-declaration.js"
],
"oids": [
"b506100a909fbf6e4369c496c17b688d66f72fca",
"b08ebfb51dc7e85b82b345943ec87f1b8737f0ea"
]
},
"filePaths": [
"var-declaration.js"
],
"sha1": "dd7a30cf841411746e9c2cdb8223b4c66651674a",
"gitDir": "test/corpus/repos/javascript",
"sha2": "fd9c694670c5f971daf4f10177c6c4eff23a8074"
}
,{
"testCaseDescription": "javascript-var-declaration-delete-insert-test",
"expectedResult": {
"rows": [
[
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "Identifier",
"range": [
4,
5
]
}
],
"patch": "delete",
"range": [
4,
5
]
},
{
"category": "VarDecl",
"children": [
{
"category": "VarAssignment",
"children": [
{
"category": "Identifier",
"range": [
7,
8
]
},
{
"category": "Object",
"children": [],
"range": [
11,
13
]
}
],
"range": [
7,
13
]
}
],
"patch": "delete",
"range": [
7,
13
]
},
{
"category": "VarDecl",
"children": [
{
"category": "Identifier",
"range": [
15,
16
]
}
],
"patch": "delete",
"range": [
15,
16
]
}
],
"range": [
0,
17
]
}
],
"range": [
0,
18
]
}
],
"hasChanges": true,
"range": [
0,
18
],
"number": 1
}
],
[
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "VarAssignment",
"children": [
{
"category": "Identifier",
"range": [
4,
5
]
},
{
"category": "NumberLiteral",
"range": [
8,
9
]
}
],
"range": [
4,
9
]
}
],
"patch": "insert",
"range": [
4,
9
]
}
],
"range": [
0,
10
]
}
],
"range": [
0,
11
]
}
],
"hasChanges": true,
"range": [
0,
11
],
"number": 1
}
],
[
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "VarAssignment",
"children": [
{
"category": "Identifier",
"range": [
22,
23
]
},
{
"category": "NumberLiteral",
"range": [
26,
27
]
}
],
"range": [
22,
27
]
}
],
"range": [
22,
27
]
}
],
"range": [
18,
28
]
}
],
"range": [
18,
29
]
}
],
"hasChanges": false,
"range": [
18,
29
],
"number": 2
},
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "VarAssignment",
"children": [
{
"category": "Identifier",
"range": [
15,
16
]
},
{
"category": "NumberLiteral",
"range": [
19,
20
]
}
],
"range": [
15,
20
]
}
],
"range": [
15,
20
]
}
],
"range": [
11,
21
]
}
],
"range": [
11,
22
]
}
],
"hasChanges": false,
"range": [
11,
22
],
"number": 2
}
],
[
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "VarAssignment",
"children": [
{
"category": "Identifier",
"range": [
33,
34
]
},
{
"category": "NumberLiteral",
"range": [
37,
38
]
}
],
"range": [
33,
38
]
}
],
"range": [
33,
38
]
}
],
"range": [
29,
39
]
}
],
"range": [
29,
40
]
}
],
"hasChanges": false,
"range": [
29,
40
],
"number": 3
},
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "VarAssignment",
"children": [
{
"category": "Identifier",
"range": [
26,
27
]
},
{
"category": "NumberLiteral",
"range": [
30,
31
]
}
],
"range": [
26,
31
]
}
],
"range": [
26,
31
]
}
],
"range": [
22,
32
]
}
],
"range": [
22,
33
]
}
],
"hasChanges": false,
"range": [
22,
33
],
"number": 3
}
],
[
{
"terms": [
{
"category": "Program",
"children": [],
"range": [
40,
40
]
}
],
"hasChanges": false,
"range": [
40,
40
],
"number": 4
},
{
"terms": [
{
"category": "Program",
"children": [],
"range": [
33,
33
]
}
],
"hasChanges": false,
"range": [
33,
33
],
"number": 4
}
]
],
"paths": [
"var-declaration.js",
"var-declaration.js"
],
"oids": [
"b08ebfb51dc7e85b82b345943ec87f1b8737f0ea",
"adc261e063c76aaa8d2314878fb928c9fbc1f64c"
]
},
"filePaths": [
"var-declaration.js"
],
"sha1": "fd9c694670c5f971daf4f10177c6c4eff23a8074",
"gitDir": "test/corpus/repos/javascript",
"sha2": "bde379d1481fedf0c2d214083e54faacd883e667"
}
,{
"testCaseDescription": "javascript-var-declaration-replacement-test",
"expectedResult": {
"rows": [
[
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "VarAssignment",
"children": [
{
"category": "Identifier",
"range": [
4,
5
]
},
{
"category": "NumberLiteral",
"range": [
8,
9
]
}
],
"patch": "replace",
"range": [
4,
9
]
}
],
"range": [
4,
9
]
}
],
"range": [
0,
10
]
}
],
"range": [
0,
11
]
}
],
"hasChanges": true,
"range": [
0,
11
],
"number": 1
},
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "Identifier",
"range": [
4,
5
]
}
],
"patch": "insert",
"range": [
4,
5
]
},
{
"category": "VarDecl",
"children": [
{
"category": "VarAssignment",
"children": [
{
"category": "Identifier",
"range": [
7,
8
]
},
{
"category": "Object",
"children": [],
"range": [
11,
13
]
}
],
"patch": "replace",
"range": [
7,
13
]
}
],
"range": [
7,
13
]
},
{
"category": "VarDecl",
"children": [
{
"category": "Identifier",
"range": [
15,
16
]
}
],
"patch": "insert",
"range": [
15,
16
]
}
],
"range": [
0,
17
]
}
],
"range": [
0,
18
]
}
],
"hasChanges": true,
"range": [
0,
18
],
"number": 1
}
],
[
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "VarAssignment",
"children": [
{
"category": "Identifier",
"range": [
15,
16
]
},
{
"category": "NumberLiteral",
"range": [
19,
20
]
}
],
"range": [
15,
20
]
}
],
"range": [
15,
20
]
}
],
"range": [
11,
21
]
}
],
"range": [
11,
22
]
}
],
"hasChanges": false,
"range": [
11,
22
],
"number": 2
},
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "VarAssignment",
"children": [
{
"category": "Identifier",
"range": [
22,
23
]
},
{
"category": "NumberLiteral",
"range": [
26,
27
]
}
],
"range": [
22,
27
]
}
],
"range": [
22,
27
]
}
],
"range": [
18,
28
]
}
],
"range": [
18,
29
]
}
],
"hasChanges": false,
"range": [
18,
29
],
"number": 2
}
],
[
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "VarAssignment",
"children": [
{
"category": "Identifier",
"range": [
26,
27
]
},
{
"category": "NumberLiteral",
"range": [
30,
31
]
}
],
"range": [
26,
31
]
}
],
"range": [
26,
31
]
}
],
"range": [
22,
32
]
}
],
"range": [
22,
33
]
}
],
"hasChanges": false,
"range": [
22,
33
],
"number": 3
},
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "VarAssignment",
"children": [
{
"category": "Identifier",
"range": [
33,
34
]
},
{
"category": "NumberLiteral",
"range": [
37,
38
]
}
],
"range": [
33,
38
]
}
],
"range": [
33,
38
]
}
],
"range": [
29,
39
]
}
],
"range": [
29,
40
]
}
],
"hasChanges": false,
"range": [
29,
40
],
"number": 3
}
],
[
{
"terms": [
{
"category": "Program",
"children": [],
"range": [
33,
33
]
}
],
"hasChanges": false,
"range": [
33,
33
],
"number": 4
},
{
"terms": [
{
"category": "Program",
"children": [],
"range": [
40,
40
]
}
],
"hasChanges": false,
"range": [
40,
40
],
"number": 4
}
]
],
"paths": [
"var-declaration.js",
"var-declaration.js"
],
"oids": [
"adc261e063c76aaa8d2314878fb928c9fbc1f64c",
"b08ebfb51dc7e85b82b345943ec87f1b8737f0ea"
]
},
"filePaths": [
"var-declaration.js"
],
"sha1": "bde379d1481fedf0c2d214083e54faacd883e667",
"gitDir": "test/corpus/repos/javascript",
"sha2": "63c0a7085853437519818462f3fb61c5eec713aa"
}
,{
"testCaseDescription": "javascript-var-declaration-delete-replacement-test",
"expectedResult": {
"rows": [
[
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "Identifier",
"range": [
4,
5
]
}
],
"range": [
4,
5
]
},
{
"category": "VarDecl",
"children": [
{
"category": "VarAssignment",
"children": [
{
"category": "Identifier",
"range": [
7,
8
]
},
{
"category": "Object",
"children": [],
"range": [
11,
13
]
}
],
"range": [
7,
13
]
}
],
"range": [
7,
13
]
},
{
"category": "VarDecl",
"children": [
{
"category": "Identifier",
"range": [
15,
16
]
}
],
"range": [
15,
16
]
}
],
"patch": "delete",
"range": [
0,
17
]
}
],
"range": [
0,
18
]
}
],
"hasChanges": true,
"range": [
0,
18
],
"number": 1
}
],
[
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "VarAssignment",
"children": [
{
"category": "Identifier",
"range": [
22,
23
]
},
{
"category": "NumberLiteral",
"range": [
26,
27
]
}
],
"range": [
22,
27
]
}
],
"range": [
22,
27
]
}
],
"patch": "delete",
"range": [
18,
28
]
}
],
"range": [
18,
29
]
}
],
"hasChanges": true,
"range": [
18,
29
],
"number": 2
}
],
[
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "VarAssignment",
"children": [
{
"category": "Identifier",
"range": [
33,
34
]
},
{
"category": "NumberLiteral",
"range": [
37,
38
]
}
],
"range": [
33,
38
]
}
],
"range": [
33,
38
]
}
],
"range": [
29,
39
]
}
],
"range": [
29,
40
]
}
],
"hasChanges": false,
"range": [
29,
40
],
"number": 3
},
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "VarAssignment",
"children": [
{
"category": "Identifier",
"range": [
4,
5
]
},
{
"category": "NumberLiteral",
"range": [
8,
9
]
}
],
"range": [
4,
9
]
}
],
"range": [
4,
9
]
}
],
"range": [
0,
10
]
}
],
"range": [
0,
11
]
}
],
"hasChanges": false,
"range": [
0,
11
],
"number": 1
}
],
[
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "Identifier",
"range": [
15,
16
]
}
],
"range": [
15,
16
]
},
{
"category": "VarDecl",
"children": [
{
"category": "VarAssignment",
"children": [
{
"category": "Identifier",
"range": [
18,
19
]
},
{
"category": "Object",
"children": [],
"range": [
22,
24
]
}
],
"range": [
18,
24
]
}
],
"range": [
18,
24
]
},
{
"category": "VarDecl",
"children": [
{
"category": "Identifier",
"range": [
26,
27
]
}
],
"range": [
26,
27
]
}
],
"patch": "insert",
"range": [
11,
28
]
}
],
"range": [
11,
29
]
}
],
"hasChanges": true,
"range": [
11,
29
],
"number": 2
}
],
[
{
"terms": [
{
"category": "Program",
"children": [],
"range": [
40,
40
]
}
],
"hasChanges": false,
"range": [
40,
40
],
"number": 4
},
{
"terms": [
{
"category": "Program",
"children": [],
"range": [
29,
29
]
}
],
"hasChanges": false,
"range": [
29,
29
],
"number": 3
}
]
],
"paths": [
"var-declaration.js",
"var-declaration.js"
],
"oids": [
"b08ebfb51dc7e85b82b345943ec87f1b8737f0ea",
"514f7c48ab10f0af9683cdeacbc1a8fa7c593782"
]
},
"filePaths": [
"var-declaration.js"
],
"sha1": "63c0a7085853437519818462f3fb61c5eec713aa",
"gitDir": "test/corpus/repos/javascript",
"sha2": "d99a948bbccd974304ed956eac90d1b1d05a7f5f"
}
,{
"testCaseDescription": "javascript-var-declaration-delete-test",
"expectedResult": {
"rows": [
[
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "VarAssignment",
"children": [
{
"category": "Identifier",
"range": [
4,
5
]
},
{
"category": "NumberLiteral",
"range": [
8,
9
]
}
],
"range": [
4,
9
]
}
],
"range": [
4,
9
]
}
],
"patch": "delete",
"range": [
0,
10
]
}
],
"range": [
0,
11
]
}
],
"hasChanges": true,
"range": [
0,
11
],
"number": 1
}
],
[
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "Identifier",
"range": [
15,
16
]
}
],
"range": [
15,
16
]
},
{
"category": "VarDecl",
"children": [
{
"category": "VarAssignment",
"children": [
{
"category": "Identifier",
"range": [
18,
19
]
},
{
"category": "Object",
"children": [],
"range": [
22,
24
]
}
],
"range": [
18,
24
]
}
],
"range": [
18,
24
]
},
{
"category": "VarDecl",
"children": [
{
"category": "Identifier",
"range": [
26,
27
]
}
],
"range": [
26,
27
]
}
],
"range": [
11,
28
]
}
],
"range": [
11,
29
]
}
],
"hasChanges": false,
"range": [
11,
29
],
"number": 2
},
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "Identifier",
"range": [
4,
5
]
}
],
"range": [
4,
5
]
},
{
"category": "VarDecl",
"children": [
{
"category": "VarAssignment",
"children": [
{
"category": "Identifier",
"range": [
7,
8
]
},
{
"category": "Object",
"children": [],
"range": [
11,
13
]
}
],
"range": [
7,
13
]
}
],
"range": [
7,
13
]
},
{
"category": "VarDecl",
"children": [
{
"category": "Identifier",
"range": [
15,
16
]
}
],
"range": [
15,
16
]
}
],
"range": [
0,
17
]
}
],
"range": [
0,
18
]
}
],
"hasChanges": false,
"range": [
0,
18
],
"number": 1
}
],
[
{
"terms": [
{
"category": "Program",
"children": [],
"range": [
29,
29
]
}
],
"hasChanges": false,
"range": [
29,
29
],
"number": 3
},
{
"terms": [
{
"category": "Program",
"children": [],
"range": [
18,
18
]
}
],
"hasChanges": false,
"range": [
18,
18
],
"number": 2
}
]
],
"paths": [
"var-declaration.js",
"var-declaration.js"
],
"oids": [
"514f7c48ab10f0af9683cdeacbc1a8fa7c593782",
"9fc69e2ff003350e601930d96926d9439a84817d"
]
},
"filePaths": [
"var-declaration.js"
],
"sha1": "d99a948bbccd974304ed956eac90d1b1d05a7f5f",
"gitDir": "test/corpus/repos/javascript",
"sha2": "1c5b4f19c4bc6fce439dca3192cfb27167e62280"
}
,{
"testCaseDescription": "javascript-var-declaration-delete-rest-test",
"expectedResult": {
"rows": [
[
{
"terms": [
{
"category": "Program",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "VarDecl",
"children": [
{
"category": "Identifier",
"range": [
4,
5
]
}
],
"range": [
4,
5
]
},
{
"category": "VarDecl",
"children": [
{
"category": "VarAssignment",
"children": [
{
"category": "Identifier",
"range": [
7,
8
]
},
{
"category": "Object",
"children": [],
"range": [
11,
13
]
}
],
"range": [
7,
13
]
}
],
"range": [
7,
13
]
},
{
"category": "VarDecl",
"children": [
{
"category": "Identifier",
"range": [
15,
16
]
}
],
"range": [
15,
16
]
}
],
"range": [
0,
17
]
}
],
"patch": "delete",
"range": [
0,
18
]
}
],
"hasChanges": true,
"range": [
0,
18
],
"number": 1
}
],
[
{
"terms": [
{
"category": "Program",
"children": [],
"patch": "delete",
"range": [
18,
18
]
}
],
"hasChanges": true,
"range": [
18,
18
],
"number": 2
}
]
],
"paths": [
"var-declaration.js",
"var-declaration.js"
],
"oids": [
"9fc69e2ff003350e601930d96926d9439a84817d",
"e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"
]
},
"filePaths": [
"var-declaration.js"
],
"sha1": "1c5b4f19c4bc6fce439dca3192cfb27167e62280",
"gitDir": "test/corpus/repos/javascript",
"sha2": "c360f948051e18243b866c2415ad1a36a09d9637"
}]