mirror of
https://github.com/github/semantic.git
synced 2024-12-27 08:54:14 +03:00
1813 lines
73 KiB
JSON
1813 lines
73 KiB
JSON
[{
|
|
"testCaseDescription": "javascript-subscript-access-string-insert-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "SubscriptAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
0,
|
|
1
|
|
]
|
|
},
|
|
{
|
|
"category": "StringLiteral",
|
|
"range": [
|
|
2,
|
|
15
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
16
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
17
|
|
]
|
|
}
|
|
],
|
|
"patch": "insert",
|
|
"range": [
|
|
0,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
18
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"patch": "insert",
|
|
"range": [
|
|
18,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
18,
|
|
18
|
|
],
|
|
"number": 2
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"subscript-access-string.js",
|
|
"subscript-access-string.js"
|
|
],
|
|
"oids": [
|
|
"e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
|
|
"429371721d335f8f5952d657097e24b250b7812e"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"subscript-access-string.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/subscript-access-string.js b/subscript-access-string.js",
|
|
"index e69de29..4293717 100644",
|
|
"--- a/subscript-access-string.js",
|
|
"+++ b/subscript-access-string.js",
|
|
"@@ -0,0 +1 @@",
|
|
"+x[\"some-string\"];"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "b120fb35e9c89d5480c33ff8e9e5d6e5e3632044..dd9d1fbb38c80adc7d93543e65d007cee202ccda"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-subscript-access-string-replacement-insert-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "SubscriptAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
0,
|
|
1
|
|
]
|
|
},
|
|
{
|
|
"category": "StringLiteral",
|
|
"range": [
|
|
2,
|
|
21
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
22
|
|
]
|
|
}
|
|
],
|
|
"patch": "insert",
|
|
"range": [
|
|
0,
|
|
23
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
24
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
24
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "SubscriptAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
24,
|
|
25
|
|
]
|
|
},
|
|
{
|
|
"category": "StringLiteral",
|
|
"range": [
|
|
26,
|
|
39
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
24,
|
|
40
|
|
]
|
|
}
|
|
],
|
|
"patch": "insert",
|
|
"range": [
|
|
24,
|
|
41
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
24,
|
|
42
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
24,
|
|
42
|
|
],
|
|
"number": 2
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "SubscriptAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
0,
|
|
1
|
|
]
|
|
},
|
|
{
|
|
"category": "StringLiteral",
|
|
"range": [
|
|
2,
|
|
15
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
16
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
17
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
0,
|
|
18
|
|
],
|
|
"number": 1
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "SubscriptAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
42,
|
|
43
|
|
]
|
|
},
|
|
{
|
|
"category": "StringLiteral",
|
|
"range": [
|
|
44,
|
|
57
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
42,
|
|
58
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
42,
|
|
59
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
42,
|
|
60
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
42,
|
|
60
|
|
],
|
|
"number": 3
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
18,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
18,
|
|
18
|
|
],
|
|
"number": 2
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
60,
|
|
60
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
60,
|
|
60
|
|
],
|
|
"number": 4
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"subscript-access-string.js",
|
|
"subscript-access-string.js"
|
|
],
|
|
"oids": [
|
|
"429371721d335f8f5952d657097e24b250b7812e",
|
|
"42930094b4f069ce252e9beed6e58ea153476f18"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"subscript-access-string.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/subscript-access-string.js b/subscript-access-string.js",
|
|
"index 4293717..4293009 100644",
|
|
"--- a/subscript-access-string.js",
|
|
"+++ b/subscript-access-string.js",
|
|
"@@ -1 +1,3 @@",
|
|
"+x[\"some-other-string\"];",
|
|
"+x[\"some-string\"];",
|
|
" x[\"some-string\"];"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "dd9d1fbb38c80adc7d93543e65d007cee202ccda..5fa07084afb4fe828fd53c393c48c3231ecbe900"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-subscript-access-string-delete-insert-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "SubscriptAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
0,
|
|
1
|
|
]
|
|
},
|
|
{
|
|
"category": "StringLiteral",
|
|
"patch": "replace",
|
|
"range": [
|
|
2,
|
|
21
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
22
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
23
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
24
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
24
|
|
],
|
|
"number": 1
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "SubscriptAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
0,
|
|
1
|
|
]
|
|
},
|
|
{
|
|
"category": "StringLiteral",
|
|
"patch": "replace",
|
|
"range": [
|
|
2,
|
|
15
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
16
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
17
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
18
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "SubscriptAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
24,
|
|
25
|
|
]
|
|
},
|
|
{
|
|
"category": "StringLiteral",
|
|
"range": [
|
|
26,
|
|
39
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
24,
|
|
40
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
24,
|
|
41
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
24,
|
|
42
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
24,
|
|
42
|
|
],
|
|
"number": 2
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "SubscriptAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
18,
|
|
19
|
|
]
|
|
},
|
|
{
|
|
"category": "StringLiteral",
|
|
"range": [
|
|
20,
|
|
33
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
18,
|
|
34
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
18,
|
|
35
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
18,
|
|
36
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
18,
|
|
36
|
|
],
|
|
"number": 2
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "SubscriptAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
42,
|
|
43
|
|
]
|
|
},
|
|
{
|
|
"category": "StringLiteral",
|
|
"range": [
|
|
44,
|
|
57
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
42,
|
|
58
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
42,
|
|
59
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
42,
|
|
60
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
42,
|
|
60
|
|
],
|
|
"number": 3
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "SubscriptAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
36,
|
|
37
|
|
]
|
|
},
|
|
{
|
|
"category": "StringLiteral",
|
|
"range": [
|
|
38,
|
|
51
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
36,
|
|
52
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
36,
|
|
53
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
36,
|
|
54
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
36,
|
|
54
|
|
],
|
|
"number": 3
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
60,
|
|
60
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
60,
|
|
60
|
|
],
|
|
"number": 4
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
54,
|
|
54
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
54,
|
|
54
|
|
],
|
|
"number": 4
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"subscript-access-string.js",
|
|
"subscript-access-string.js"
|
|
],
|
|
"oids": [
|
|
"42930094b4f069ce252e9beed6e58ea153476f18",
|
|
"c53d07bbc992afb317ee398756c832650830f46d"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"subscript-access-string.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/subscript-access-string.js b/subscript-access-string.js",
|
|
"index 4293009..c53d07b 100644",
|
|
"--- a/subscript-access-string.js",
|
|
"+++ b/subscript-access-string.js",
|
|
"@@ -1,3 +1,3 @@",
|
|
"-x[\"some-other-string\"];",
|
|
"+x[\"some-string\"];",
|
|
" x[\"some-string\"];",
|
|
" x[\"some-string\"];"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "5fa07084afb4fe828fd53c393c48c3231ecbe900..4489ef48c1815a018870abb9af375cf9e6fcd5d9"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-subscript-access-string-replacement-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "SubscriptAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
0,
|
|
1
|
|
]
|
|
},
|
|
{
|
|
"category": "StringLiteral",
|
|
"patch": "replace",
|
|
"range": [
|
|
2,
|
|
15
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
16
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
17
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
18
|
|
],
|
|
"number": 1
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "SubscriptAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
0,
|
|
1
|
|
]
|
|
},
|
|
{
|
|
"category": "StringLiteral",
|
|
"patch": "replace",
|
|
"range": [
|
|
2,
|
|
21
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
22
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
23
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
24
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
24
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "SubscriptAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
18,
|
|
19
|
|
]
|
|
},
|
|
{
|
|
"category": "StringLiteral",
|
|
"range": [
|
|
20,
|
|
33
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
18,
|
|
34
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
18,
|
|
35
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
18,
|
|
36
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
18,
|
|
36
|
|
],
|
|
"number": 2
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "SubscriptAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
24,
|
|
25
|
|
]
|
|
},
|
|
{
|
|
"category": "StringLiteral",
|
|
"range": [
|
|
26,
|
|
39
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
24,
|
|
40
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
24,
|
|
41
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
24,
|
|
42
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
24,
|
|
42
|
|
],
|
|
"number": 2
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "SubscriptAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
36,
|
|
37
|
|
]
|
|
},
|
|
{
|
|
"category": "StringLiteral",
|
|
"range": [
|
|
38,
|
|
51
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
36,
|
|
52
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
36,
|
|
53
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
36,
|
|
54
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
36,
|
|
54
|
|
],
|
|
"number": 3
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "SubscriptAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
42,
|
|
43
|
|
]
|
|
},
|
|
{
|
|
"category": "StringLiteral",
|
|
"range": [
|
|
44,
|
|
57
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
42,
|
|
58
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
42,
|
|
59
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
42,
|
|
60
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
42,
|
|
60
|
|
],
|
|
"number": 3
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
54,
|
|
54
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
54,
|
|
54
|
|
],
|
|
"number": 4
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
60,
|
|
60
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
60,
|
|
60
|
|
],
|
|
"number": 4
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"subscript-access-string.js",
|
|
"subscript-access-string.js"
|
|
],
|
|
"oids": [
|
|
"c53d07bbc992afb317ee398756c832650830f46d",
|
|
"42930094b4f069ce252e9beed6e58ea153476f18"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"subscript-access-string.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/subscript-access-string.js b/subscript-access-string.js",
|
|
"index c53d07b..4293009 100644",
|
|
"--- a/subscript-access-string.js",
|
|
"+++ b/subscript-access-string.js",
|
|
"@@ -1,3 +1,3 @@",
|
|
"-x[\"some-string\"];",
|
|
"+x[\"some-other-string\"];",
|
|
" x[\"some-string\"];",
|
|
" x[\"some-string\"];"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "4489ef48c1815a018870abb9af375cf9e6fcd5d9..f0af83c1698f1b4d000ab66e4432d87b0620d75c"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-subscript-access-string-delete-replacement-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "SubscriptAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
0,
|
|
1
|
|
]
|
|
},
|
|
{
|
|
"category": "StringLiteral",
|
|
"range": [
|
|
2,
|
|
21
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
22
|
|
]
|
|
}
|
|
],
|
|
"patch": "delete",
|
|
"range": [
|
|
0,
|
|
23
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
24
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
24
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "SubscriptAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
24,
|
|
25
|
|
]
|
|
},
|
|
{
|
|
"category": "StringLiteral",
|
|
"range": [
|
|
26,
|
|
39
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
24,
|
|
40
|
|
]
|
|
}
|
|
],
|
|
"patch": "delete",
|
|
"range": [
|
|
24,
|
|
41
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
24,
|
|
42
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
24,
|
|
42
|
|
],
|
|
"number": 2
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "SubscriptAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
42,
|
|
43
|
|
]
|
|
},
|
|
{
|
|
"category": "StringLiteral",
|
|
"range": [
|
|
44,
|
|
57
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
42,
|
|
58
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
42,
|
|
59
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
42,
|
|
60
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
42,
|
|
60
|
|
],
|
|
"number": 3
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "SubscriptAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
0,
|
|
1
|
|
]
|
|
},
|
|
{
|
|
"category": "StringLiteral",
|
|
"range": [
|
|
2,
|
|
15
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
16
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
17
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
0,
|
|
18
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "SubscriptAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
18,
|
|
19
|
|
]
|
|
},
|
|
{
|
|
"category": "StringLiteral",
|
|
"range": [
|
|
20,
|
|
39
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
18,
|
|
40
|
|
]
|
|
}
|
|
],
|
|
"patch": "insert",
|
|
"range": [
|
|
18,
|
|
41
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
18,
|
|
42
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
18,
|
|
42
|
|
],
|
|
"number": 2
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
60,
|
|
60
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
60,
|
|
60
|
|
],
|
|
"number": 4
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
42,
|
|
42
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
42,
|
|
42
|
|
],
|
|
"number": 3
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"subscript-access-string.js",
|
|
"subscript-access-string.js"
|
|
],
|
|
"oids": [
|
|
"42930094b4f069ce252e9beed6e58ea153476f18",
|
|
"89c1bc26de340529ad66f499e608dfe2a4bc889b"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"subscript-access-string.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/subscript-access-string.js b/subscript-access-string.js",
|
|
"index 4293009..89c1bc2 100644",
|
|
"--- a/subscript-access-string.js",
|
|
"+++ b/subscript-access-string.js",
|
|
"@@ -1,3 +1,2 @@",
|
|
"-x[\"some-other-string\"];",
|
|
"-x[\"some-string\"];",
|
|
" x[\"some-string\"];",
|
|
"+x[\"some-other-string\"];"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "f0af83c1698f1b4d000ab66e4432d87b0620d75c..e35c768f935b688b4f01e54dd0b370e63c17d745"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-subscript-access-string-delete-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "SubscriptAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
0,
|
|
1
|
|
]
|
|
},
|
|
{
|
|
"category": "StringLiteral",
|
|
"range": [
|
|
2,
|
|
15
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
16
|
|
]
|
|
}
|
|
],
|
|
"patch": "delete",
|
|
"range": [
|
|
0,
|
|
17
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
18
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "SubscriptAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
18,
|
|
19
|
|
]
|
|
},
|
|
{
|
|
"category": "StringLiteral",
|
|
"range": [
|
|
20,
|
|
39
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
18,
|
|
40
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
18,
|
|
41
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
18,
|
|
42
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
18,
|
|
42
|
|
],
|
|
"number": 2
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "SubscriptAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
0,
|
|
1
|
|
]
|
|
},
|
|
{
|
|
"category": "StringLiteral",
|
|
"range": [
|
|
2,
|
|
21
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
22
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
23
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
24
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
0,
|
|
24
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
42,
|
|
42
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
42,
|
|
42
|
|
],
|
|
"number": 3
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
24,
|
|
24
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
24,
|
|
24
|
|
],
|
|
"number": 2
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"subscript-access-string.js",
|
|
"subscript-access-string.js"
|
|
],
|
|
"oids": [
|
|
"89c1bc26de340529ad66f499e608dfe2a4bc889b",
|
|
"758f8e70bb0ac4bda738fda6de26837148d6c5fe"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"subscript-access-string.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/subscript-access-string.js b/subscript-access-string.js",
|
|
"index 89c1bc2..758f8e7 100644",
|
|
"--- a/subscript-access-string.js",
|
|
"+++ b/subscript-access-string.js",
|
|
"@@ -1,2 +1 @@",
|
|
"-x[\"some-string\"];",
|
|
" x[\"some-other-string\"];"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "e35c768f935b688b4f01e54dd0b370e63c17d745..f09c45712b4b483d42fa9eea14005cfffb916cb9"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-subscript-access-string-delete-rest-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "SubscriptAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
0,
|
|
1
|
|
]
|
|
},
|
|
{
|
|
"category": "StringLiteral",
|
|
"range": [
|
|
2,
|
|
21
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
22
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
23
|
|
]
|
|
}
|
|
],
|
|
"patch": "delete",
|
|
"range": [
|
|
0,
|
|
24
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
24
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"patch": "delete",
|
|
"range": [
|
|
24,
|
|
24
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
24,
|
|
24
|
|
],
|
|
"number": 2
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"subscript-access-string.js",
|
|
"subscript-access-string.js"
|
|
],
|
|
"oids": [
|
|
"758f8e70bb0ac4bda738fda6de26837148d6c5fe",
|
|
"e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"subscript-access-string.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/subscript-access-string.js b/subscript-access-string.js",
|
|
"index 758f8e7..e69de29 100644",
|
|
"--- a/subscript-access-string.js",
|
|
"+++ b/subscript-access-string.js",
|
|
"@@ -1 +0,0 @@",
|
|
"-x[\"some-other-string\"];"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "f09c45712b4b483d42fa9eea14005cfffb916cb9..6a24d1bc284fee3110e5699439106922f5381fd5"
|
|
}]
|