mirror of
https://github.com/github/semantic.git
synced 2024-12-23 14:54:16 +03:00
468 lines
15 KiB
JSON
468 lines
15 KiB
JSON
[{
|
|
"testCaseDescription": "javascript-named-function-insert-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"named-function.js": [
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
1,
|
|
42
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'myFunction' function"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"named-function.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/named-function.js b/named-function.js",
|
|
"index e69de29..94b19f8 100644",
|
|
"--- a/named-function.js",
|
|
"+++ b/named-function.js",
|
|
"@@ -0,0 +1 @@",
|
|
"+function myFunction(arg1, arg2) { arg2; };"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "973cce7b94116a9e6e8b399f9f0a50bd107fb9b5..0af41b91893fcc8e9172616a4e5a71c70ee47985"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-named-function-replacement-insert-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"named-function.js": [
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
1,
|
|
45
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'anotherFunction' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
2,
|
|
1
|
|
],
|
|
"end": [
|
|
2,
|
|
42
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'myFunction' function"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"named-function.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/named-function.js b/named-function.js",
|
|
"index 94b19f8..cb766a0 100644",
|
|
"--- a/named-function.js",
|
|
"+++ b/named-function.js",
|
|
"@@ -1 +1,3 @@",
|
|
"+function anotherFunction() { return false; };",
|
|
"+function myFunction(arg1, arg2) { arg2; };",
|
|
" function myFunction(arg1, arg2) { arg2; };"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "0af41b91893fcc8e9172616a4e5a71c70ee47985..2fe69bd38fe1db507331dc14063479b66eb2a880"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-named-function-delete-insert-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"named-function.js": [
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
1,
|
|
10
|
|
],
|
|
"end": [
|
|
1,
|
|
25
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
1,
|
|
10
|
|
],
|
|
"end": [
|
|
1,
|
|
20
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'anotherFunction' identifier with the 'myFunction' identifier in the myFunction function"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
1,
|
|
21
|
|
],
|
|
"end": [
|
|
1,
|
|
25
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'arg1' identifier in the myFunction function"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
1,
|
|
27
|
|
],
|
|
"end": [
|
|
1,
|
|
31
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'arg2' identifier in the myFunction function"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
1,
|
|
35
|
|
],
|
|
"end": [
|
|
1,
|
|
39
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'arg2' identifier in the myFunction function"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
1,
|
|
30
|
|
],
|
|
"end": [
|
|
1,
|
|
43
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'false' return statement in the myFunction function"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"named-function.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/named-function.js b/named-function.js",
|
|
"index cb766a0..c9cff07 100644",
|
|
"--- a/named-function.js",
|
|
"+++ b/named-function.js",
|
|
"@@ -1,3 +1,3 @@",
|
|
"-function anotherFunction() { return false; };",
|
|
"+function myFunction(arg1, arg2) { arg2; };",
|
|
" function myFunction(arg1, arg2) { arg2; };",
|
|
" function myFunction(arg1, arg2) { arg2; };"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "2fe69bd38fe1db507331dc14063479b66eb2a880..4b0a0bcf80003eb74b67b8947f8a0443cb2ad80f"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-named-function-replacement-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"named-function.js": [
|
|
{
|
|
"span": {
|
|
"replace": [
|
|
{
|
|
"start": [
|
|
1,
|
|
10
|
|
],
|
|
"end": [
|
|
1,
|
|
20
|
|
]
|
|
},
|
|
{
|
|
"start": [
|
|
1,
|
|
10
|
|
],
|
|
"end": [
|
|
1,
|
|
25
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"summary": "Replaced the 'myFunction' identifier with the 'anotherFunction' identifier in the anotherFunction function"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
1,
|
|
21
|
|
],
|
|
"end": [
|
|
1,
|
|
25
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'arg1' identifier in the anotherFunction function"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
1,
|
|
27
|
|
],
|
|
"end": [
|
|
1,
|
|
31
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'arg2' identifier in the anotherFunction function"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
1,
|
|
30
|
|
],
|
|
"end": [
|
|
1,
|
|
43
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'false' return statement in the anotherFunction function"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
1,
|
|
35
|
|
],
|
|
"end": [
|
|
1,
|
|
39
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'arg2' identifier in the anotherFunction function"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"named-function.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/named-function.js b/named-function.js",
|
|
"index c9cff07..cb766a0 100644",
|
|
"--- a/named-function.js",
|
|
"+++ b/named-function.js",
|
|
"@@ -1,3 +1,3 @@",
|
|
"-function myFunction(arg1, arg2) { arg2; };",
|
|
"+function anotherFunction() { return false; };",
|
|
" function myFunction(arg1, arg2) { arg2; };",
|
|
" function myFunction(arg1, arg2) { arg2; };"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "4b0a0bcf80003eb74b67b8947f8a0443cb2ad80f..785a621c11eb5f6e1e93d2ea1e40828c8786ae2d"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-named-function-delete-replacement-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"named-function.js": [
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
1,
|
|
45
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'anotherFunction' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
2,
|
|
1
|
|
],
|
|
"end": [
|
|
2,
|
|
42
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'myFunction' function"
|
|
},
|
|
{
|
|
"span": {
|
|
"insert": {
|
|
"start": [
|
|
2,
|
|
1
|
|
],
|
|
"end": [
|
|
2,
|
|
45
|
|
]
|
|
}
|
|
},
|
|
"summary": "Added the 'anotherFunction' function"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"named-function.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/named-function.js b/named-function.js",
|
|
"index cb766a0..148bcc7 100644",
|
|
"--- a/named-function.js",
|
|
"+++ b/named-function.js",
|
|
"@@ -1,3 +1,2 @@",
|
|
"-function anotherFunction() { return false; };",
|
|
"-function myFunction(arg1, arg2) { arg2; };",
|
|
" function myFunction(arg1, arg2) { arg2; };",
|
|
"+function anotherFunction() { return false; };"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "785a621c11eb5f6e1e93d2ea1e40828c8786ae2d..7ecdd3334fd0090f017044bd0780b5a5df128eda"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-named-function-delete-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"named-function.js": [
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
1,
|
|
42
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'myFunction' function"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"named-function.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/named-function.js b/named-function.js",
|
|
"index 148bcc7..80e11b0 100644",
|
|
"--- a/named-function.js",
|
|
"+++ b/named-function.js",
|
|
"@@ -1,2 +1 @@",
|
|
"-function myFunction(arg1, arg2) { arg2; };",
|
|
" function anotherFunction() { return false; };"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "7ecdd3334fd0090f017044bd0780b5a5df128eda..92cb451c62ab6f9a63bad5a24b21beb2cbe9bdde"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-named-function-delete-rest-test",
|
|
"expectedResult": {
|
|
"changes": {
|
|
"named-function.js": [
|
|
{
|
|
"span": {
|
|
"delete": {
|
|
"start": [
|
|
1,
|
|
1
|
|
],
|
|
"end": [
|
|
1,
|
|
45
|
|
]
|
|
}
|
|
},
|
|
"summary": "Deleted the 'anotherFunction' function"
|
|
}
|
|
]
|
|
},
|
|
"errors": {}
|
|
},
|
|
"filePaths": [
|
|
"named-function.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/named-function.js b/named-function.js",
|
|
"index 80e11b0..e69de29 100644",
|
|
"--- a/named-function.js",
|
|
"+++ b/named-function.js",
|
|
"@@ -1 +0,0 @@",
|
|
"-function anotherFunction() { return false; };"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "92cb451c62ab6f9a63bad5a24b21beb2cbe9bdde..0cbc55e481f01ab536c7832c5ebbc21d7f9e9021"
|
|
}]
|