mirror of
https://github.com/github/semantic.git
synced 2024-12-22 22:31:36 +03:00
2285 lines
103 KiB
JSON
2285 lines
103 KiB
JSON
[{
|
|
"testCaseDescription": "javascript-while-statement-insert-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
7,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
12,
|
|
13
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
15
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
16
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
10,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"patch": "insert",
|
|
"range": [
|
|
0,
|
|
20
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
20
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"patch": "insert",
|
|
"range": [
|
|
20,
|
|
20
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
20,
|
|
20
|
|
],
|
|
"number": 2
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"while-statement.js",
|
|
"while-statement.js"
|
|
],
|
|
"oids": [
|
|
"e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
|
|
"1ea2800e0ca7a6b41ac577d898eec51c21ad962a"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"while-statement.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/while-statement.js b/while-statement.js",
|
|
"index e69de29..1ea2800 100644",
|
|
"--- a/while-statement.js",
|
|
"+++ b/while-statement.js",
|
|
"@@ -0,0 +1 @@",
|
|
"+while (a) { b(); };"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "02fd2e5dc8f8de3c7dfdb7fc35ffa79ecc5a9711..48365cd31ce4a57900b5ca49962d184b15c9f70e"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-while-statement-replacement-insert-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
7,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
12,
|
|
13
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
15
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
16
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
10,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"patch": "insert",
|
|
"range": [
|
|
0,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
20
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
20
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
27,
|
|
28
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
32,
|
|
33
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
32,
|
|
35
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
32,
|
|
36
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
30,
|
|
38
|
|
]
|
|
}
|
|
],
|
|
"patch": "insert",
|
|
"range": [
|
|
20,
|
|
38
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
20,
|
|
40
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
20,
|
|
40
|
|
],
|
|
"number": 2
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
7,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
12,
|
|
13
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
15
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
16
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
10,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
20
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
0,
|
|
20
|
|
],
|
|
"number": 1
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
47,
|
|
48
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
52,
|
|
53
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
52,
|
|
55
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
52,
|
|
56
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
50,
|
|
58
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
40,
|
|
58
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
40,
|
|
60
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
40,
|
|
60
|
|
],
|
|
"number": 3
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
20,
|
|
20
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
20,
|
|
20
|
|
],
|
|
"number": 2
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
60,
|
|
60
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
60,
|
|
60
|
|
],
|
|
"number": 4
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"while-statement.js",
|
|
"while-statement.js"
|
|
],
|
|
"oids": [
|
|
"1ea2800e0ca7a6b41ac577d898eec51c21ad962a",
|
|
"c322323db2c1f69ea9937e346fe02f353d747421"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"while-statement.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/while-statement.js b/while-statement.js",
|
|
"index 1ea2800..c322323 100644",
|
|
"--- a/while-statement.js",
|
|
"+++ b/while-statement.js",
|
|
"@@ -1 +1,3 @@",
|
|
"+while (b) { a(); };",
|
|
"+while (a) { b(); };",
|
|
" while (a) { b(); };"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "48365cd31ce4a57900b5ca49962d184b15c9f70e..86345f2375bc709f3fc6ea8887e18d1e5060d2e4"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-while-statement-delete-insert-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"patch": "replace",
|
|
"range": [
|
|
7,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"patch": "replace",
|
|
"range": [
|
|
12,
|
|
13
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
15
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
16
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
10,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
20
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
20
|
|
],
|
|
"number": 1
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"patch": "replace",
|
|
"range": [
|
|
7,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"patch": "replace",
|
|
"range": [
|
|
12,
|
|
13
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
15
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
16
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
10,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
20
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
20
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
27,
|
|
28
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
32,
|
|
33
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
32,
|
|
35
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
32,
|
|
36
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
30,
|
|
38
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
20,
|
|
38
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
20,
|
|
40
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
20,
|
|
40
|
|
],
|
|
"number": 2
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
27,
|
|
28
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
32,
|
|
33
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
32,
|
|
35
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
32,
|
|
36
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
30,
|
|
38
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
20,
|
|
38
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
20,
|
|
40
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
20,
|
|
40
|
|
],
|
|
"number": 2
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
47,
|
|
48
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
52,
|
|
53
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
52,
|
|
55
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
52,
|
|
56
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
50,
|
|
58
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
40,
|
|
58
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
40,
|
|
60
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
40,
|
|
60
|
|
],
|
|
"number": 3
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
47,
|
|
48
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
52,
|
|
53
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
52,
|
|
55
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
52,
|
|
56
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
50,
|
|
58
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
40,
|
|
58
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
40,
|
|
60
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
40,
|
|
60
|
|
],
|
|
"number": 3
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
60,
|
|
60
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
60,
|
|
60
|
|
],
|
|
"number": 4
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
60,
|
|
60
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
60,
|
|
60
|
|
],
|
|
"number": 4
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"while-statement.js",
|
|
"while-statement.js"
|
|
],
|
|
"oids": [
|
|
"c322323db2c1f69ea9937e346fe02f353d747421",
|
|
"ea967164613fa8014fc806c3847699f5a0b4a2ce"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"while-statement.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/while-statement.js b/while-statement.js",
|
|
"index c322323..ea96716 100644",
|
|
"--- a/while-statement.js",
|
|
"+++ b/while-statement.js",
|
|
"@@ -1,3 +1,3 @@",
|
|
"-while (b) { a(); };",
|
|
"+while (a) { b(); };",
|
|
" while (a) { b(); };",
|
|
" while (a) { b(); };"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "86345f2375bc709f3fc6ea8887e18d1e5060d2e4..a64a57b19839fdebcbdb61f4a5642a4bdfd48665"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-while-statement-replacement-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"patch": "replace",
|
|
"range": [
|
|
7,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"patch": "replace",
|
|
"range": [
|
|
12,
|
|
13
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
15
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
16
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
10,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
20
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
20
|
|
],
|
|
"number": 1
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"patch": "replace",
|
|
"range": [
|
|
7,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"patch": "replace",
|
|
"range": [
|
|
12,
|
|
13
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
15
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
16
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
10,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
20
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
20
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
27,
|
|
28
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
32,
|
|
33
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
32,
|
|
35
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
32,
|
|
36
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
30,
|
|
38
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
20,
|
|
38
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
20,
|
|
40
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
20,
|
|
40
|
|
],
|
|
"number": 2
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
27,
|
|
28
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
32,
|
|
33
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
32,
|
|
35
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
32,
|
|
36
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
30,
|
|
38
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
20,
|
|
38
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
20,
|
|
40
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
20,
|
|
40
|
|
],
|
|
"number": 2
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
47,
|
|
48
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
52,
|
|
53
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
52,
|
|
55
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
52,
|
|
56
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
50,
|
|
58
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
40,
|
|
58
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
40,
|
|
60
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
40,
|
|
60
|
|
],
|
|
"number": 3
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
47,
|
|
48
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
52,
|
|
53
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
52,
|
|
55
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
52,
|
|
56
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
50,
|
|
58
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
40,
|
|
58
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
40,
|
|
60
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
40,
|
|
60
|
|
],
|
|
"number": 3
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
60,
|
|
60
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
60,
|
|
60
|
|
],
|
|
"number": 4
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
60,
|
|
60
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
60,
|
|
60
|
|
],
|
|
"number": 4
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"while-statement.js",
|
|
"while-statement.js"
|
|
],
|
|
"oids": [
|
|
"ea967164613fa8014fc806c3847699f5a0b4a2ce",
|
|
"c322323db2c1f69ea9937e346fe02f353d747421"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"while-statement.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/while-statement.js b/while-statement.js",
|
|
"index ea96716..c322323 100644",
|
|
"--- a/while-statement.js",
|
|
"+++ b/while-statement.js",
|
|
"@@ -1,3 +1,3 @@",
|
|
"-while (a) { b(); };",
|
|
"+while (b) { a(); };",
|
|
" while (a) { b(); };",
|
|
" while (a) { b(); };"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "a64a57b19839fdebcbdb61f4a5642a4bdfd48665..f3fcb2d82f063979f6ef99e5d5a929717c439e1e"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-while-statement-delete-replacement-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
7,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
12,
|
|
13
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
15
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
16
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
10,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"patch": "delete",
|
|
"range": [
|
|
0,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
20
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
20
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
27,
|
|
28
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
32,
|
|
33
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
32,
|
|
35
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
32,
|
|
36
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
30,
|
|
38
|
|
]
|
|
}
|
|
],
|
|
"patch": "delete",
|
|
"range": [
|
|
20,
|
|
38
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
20,
|
|
40
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
20,
|
|
40
|
|
],
|
|
"number": 2
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
47,
|
|
48
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
52,
|
|
53
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
52,
|
|
55
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
52,
|
|
56
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
50,
|
|
58
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
40,
|
|
58
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
40,
|
|
60
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
40,
|
|
60
|
|
],
|
|
"number": 3
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
7,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
12,
|
|
13
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
15
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
16
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
10,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
20
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
0,
|
|
20
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
27,
|
|
28
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
32,
|
|
33
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
32,
|
|
35
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
32,
|
|
36
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
30,
|
|
38
|
|
]
|
|
}
|
|
],
|
|
"patch": "insert",
|
|
"range": [
|
|
20,
|
|
38
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
20,
|
|
40
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
20,
|
|
40
|
|
],
|
|
"number": 2
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
60,
|
|
60
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
60,
|
|
60
|
|
],
|
|
"number": 4
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
40,
|
|
40
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
40,
|
|
40
|
|
],
|
|
"number": 3
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"while-statement.js",
|
|
"while-statement.js"
|
|
],
|
|
"oids": [
|
|
"c322323db2c1f69ea9937e346fe02f353d747421",
|
|
"28f4b2107aeca302af288a59f29d76c30c9dc0ed"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"while-statement.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/while-statement.js b/while-statement.js",
|
|
"index c322323..28f4b21 100644",
|
|
"--- a/while-statement.js",
|
|
"+++ b/while-statement.js",
|
|
"@@ -1,3 +1,2 @@",
|
|
"-while (b) { a(); };",
|
|
"-while (a) { b(); };",
|
|
" while (a) { b(); };",
|
|
"+while (b) { a(); };"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "f3fcb2d82f063979f6ef99e5d5a929717c439e1e..417ef021cba8565bf05177eee6db64ed17d9a93b"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-while-statement-delete-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
7,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
12,
|
|
13
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
15
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
16
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
10,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"patch": "delete",
|
|
"range": [
|
|
0,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
20
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
20
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
27,
|
|
28
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
32,
|
|
33
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
32,
|
|
35
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
32,
|
|
36
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
30,
|
|
38
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
20,
|
|
38
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
20,
|
|
40
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
20,
|
|
40
|
|
],
|
|
"number": 2
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
7,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
12,
|
|
13
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
15
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
16
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
10,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
20
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
0,
|
|
20
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
40,
|
|
40
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
40,
|
|
40
|
|
],
|
|
"number": 3
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
20,
|
|
20
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
20,
|
|
20
|
|
],
|
|
"number": 2
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"while-statement.js",
|
|
"while-statement.js"
|
|
],
|
|
"oids": [
|
|
"28f4b2107aeca302af288a59f29d76c30c9dc0ed",
|
|
"e185b25d092e4a5402a6033691dcc52be2c7a8aa"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"while-statement.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/while-statement.js b/while-statement.js",
|
|
"index 28f4b21..e185b25 100644",
|
|
"--- a/while-statement.js",
|
|
"+++ b/while-statement.js",
|
|
"@@ -1,2 +1 @@",
|
|
"-while (a) { b(); };",
|
|
" while (b) { a(); };"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "417ef021cba8565bf05177eee6db64ed17d9a93b..c8b46cd494ffd16d1119cab7f07db437b173b372"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-while-statement-delete-rest-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
7,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
12,
|
|
13
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
15
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
16
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
10,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"patch": "delete",
|
|
"range": [
|
|
0,
|
|
20
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
20
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"patch": "delete",
|
|
"range": [
|
|
20,
|
|
20
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
20,
|
|
20
|
|
],
|
|
"number": 2
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"while-statement.js",
|
|
"while-statement.js"
|
|
],
|
|
"oids": [
|
|
"e185b25d092e4a5402a6033691dcc52be2c7a8aa",
|
|
"e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"while-statement.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/while-statement.js b/while-statement.js",
|
|
"index e185b25..e69de29 100644",
|
|
"--- a/while-statement.js",
|
|
"+++ b/while-statement.js",
|
|
"@@ -1 +0,0 @@",
|
|
"-while (b) { a(); };"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "c8b46cd494ffd16d1119cab7f07db437b173b372..a22f0481bc6a70fba4f09d450abc7b2787f85762"
|
|
}]
|