1
1
mirror of https://github.com/github/semantic.git synced 2024-12-23 14:54:16 +03:00
semantic/test/corpus/diff-summaries/javascript/anonymous-function.json
Timothy Clem 85367c9312 Allow proper diffing of relational, bitwise and other operators in JavaScript
Fixes #771, a long standing issue in JavaScript diffing
2016-12-06 11:59:14 -08:00

456 lines
15 KiB
JSON

[{
"testCaseDescription": "javascript-anonymous-function-insert-test",
"expectedResult": {
"changes": {
"anonymous-function.js": [
{
"span": {
"insert": {
"start": [
1,
1
],
"end": [
1,
32
]
}
},
"summary": "Added an anonymous(a, b) function"
}
]
},
"errors": {}
},
"filePaths": [
"anonymous-function.js"
],
"patch": [
"diff --git a/anonymous-function.js b/anonymous-function.js",
"index e69de29b..b5928681 100644",
"--- a/anonymous-function.js",
"+++ b/anonymous-function.js",
"@@ -0,0 +1 @@",
"+function(a,b) { return a + b; }"
],
"gitDir": "test/corpus/repos/javascript",
"shas": "07a785cb4f0cfa49a60fdfbbce7d8ecbfd2a820b..1ecbe6a443a701cf2b90740825d337914c3b01b8"
}
,{
"testCaseDescription": "javascript-anonymous-function-replacement-insert-test",
"expectedResult": {
"changes": {
"anonymous-function.js": [
{
"span": {
"insert": {
"start": [
1,
1
],
"end": [
1,
32
]
}
},
"summary": "Added an anonymous(b, c) function"
},
{
"span": {
"insert": {
"start": [
2,
1
],
"end": [
2,
32
]
}
},
"summary": "Added an anonymous(a, b) function"
}
]
},
"errors": {}
},
"filePaths": [
"anonymous-function.js"
],
"patch": [
"diff --git a/anonymous-function.js b/anonymous-function.js",
"index b5928681..e1de356c 100644",
"--- a/anonymous-function.js",
"+++ b/anonymous-function.js",
"@@ -1 +1,3 @@",
"+function(b,c) { return b * c; }",
"+function(a,b) { return a + b; }",
" function(a,b) { return a + b; }"
],
"gitDir": "test/corpus/repos/javascript",
"shas": "1ecbe6a443a701cf2b90740825d337914c3b01b8..1e649afd16b0e9145c760bd152b90dbf2eeb1c79"
}
,{
"testCaseDescription": "javascript-anonymous-function-delete-insert-test",
"expectedResult": {
"changes": {
"anonymous-function.js": [
{
"span": {
"replace": [
{
"start": [
1,
10
],
"end": [
1,
11
]
},
{
"start": [
1,
10
],
"end": [
1,
11
]
}
]
},
"summary": "Replaced the 'b' identifier with the 'a' identifier"
},
{
"span": {
"replace": [
{
"start": [
1,
12
],
"end": [
1,
13
]
},
{
"start": [
1,
12
],
"end": [
1,
13
]
}
]
},
"summary": "Replaced the 'c' identifier with the 'b' identifier"
},
{
"span": {
"replace": [
{
"start": [
1,
24
],
"end": [
1,
29
]
},
{
"start": [
1,
24
],
"end": [
1,
29
]
}
]
},
"summary": "Replaced the 'b * c' math operator with the 'a + b' math operator"
}
]
},
"errors": {}
},
"filePaths": [
"anonymous-function.js"
],
"patch": [
"diff --git a/anonymous-function.js b/anonymous-function.js",
"index e1de356c..4ca0d4c7 100644",
"--- a/anonymous-function.js",
"+++ b/anonymous-function.js",
"@@ -1,3 +1,3 @@",
"-function(b,c) { return b * c; }",
"+function(a,b) { return a + b; }",
" function(a,b) { return a + b; }",
" function(a,b) { return a + b; }"
],
"gitDir": "test/corpus/repos/javascript",
"shas": "1e649afd16b0e9145c760bd152b90dbf2eeb1c79..7fb344d8f58ce3935df46d0dc70e9f8f1896908f"
}
,{
"testCaseDescription": "javascript-anonymous-function-replacement-test",
"expectedResult": {
"changes": {
"anonymous-function.js": [
{
"span": {
"replace": [
{
"start": [
1,
10
],
"end": [
1,
11
]
},
{
"start": [
1,
10
],
"end": [
1,
11
]
}
]
},
"summary": "Replaced the 'a' identifier with the 'b' identifier"
},
{
"span": {
"replace": [
{
"start": [
1,
12
],
"end": [
1,
13
]
},
{
"start": [
1,
12
],
"end": [
1,
13
]
}
]
},
"summary": "Replaced the 'b' identifier with the 'c' identifier"
},
{
"span": {
"replace": [
{
"start": [
1,
24
],
"end": [
1,
29
]
},
{
"start": [
1,
24
],
"end": [
1,
29
]
}
]
},
"summary": "Replaced the 'a + b' math operator with the 'b * c' math operator"
}
]
},
"errors": {}
},
"filePaths": [
"anonymous-function.js"
],
"patch": [
"diff --git a/anonymous-function.js b/anonymous-function.js",
"index 4ca0d4c7..e1de356c 100644",
"--- a/anonymous-function.js",
"+++ b/anonymous-function.js",
"@@ -1,3 +1,3 @@",
"-function(a,b) { return a + b; }",
"+function(b,c) { return b * c; }",
" function(a,b) { return a + b; }",
" function(a,b) { return a + b; }"
],
"gitDir": "test/corpus/repos/javascript",
"shas": "7fb344d8f58ce3935df46d0dc70e9f8f1896908f..6d835d52398bfc6715ef4c40d2706dd8c11cb83a"
}
,{
"testCaseDescription": "javascript-anonymous-function-delete-replacement-test",
"expectedResult": {
"changes": {
"anonymous-function.js": [
{
"span": {
"delete": {
"start": [
1,
1
],
"end": [
1,
32
]
}
},
"summary": "Deleted an anonymous(b, c) function"
},
{
"span": {
"delete": {
"start": [
2,
1
],
"end": [
2,
32
]
}
},
"summary": "Deleted an anonymous(a, b) function"
},
{
"span": {
"insert": {
"start": [
2,
1
],
"end": [
2,
32
]
}
},
"summary": "Added an anonymous(b, c) function"
}
]
},
"errors": {}
},
"filePaths": [
"anonymous-function.js"
],
"patch": [
"diff --git a/anonymous-function.js b/anonymous-function.js",
"index e1de356c..afdaccf7 100644",
"--- a/anonymous-function.js",
"+++ b/anonymous-function.js",
"@@ -1,3 +1,2 @@",
"-function(b,c) { return b * c; }",
"-function(a,b) { return a + b; }",
" function(a,b) { return a + b; }",
"+function(b,c) { return b * c; }"
],
"gitDir": "test/corpus/repos/javascript",
"shas": "6d835d52398bfc6715ef4c40d2706dd8c11cb83a..fa0cd2354feb5199209c9aa13525567951185c88"
}
,{
"testCaseDescription": "javascript-anonymous-function-delete-test",
"expectedResult": {
"changes": {
"anonymous-function.js": [
{
"span": {
"delete": {
"start": [
1,
1
],
"end": [
1,
32
]
}
},
"summary": "Deleted an anonymous(a, b) function"
}
]
},
"errors": {}
},
"filePaths": [
"anonymous-function.js"
],
"patch": [
"diff --git a/anonymous-function.js b/anonymous-function.js",
"index afdaccf7..9f1856f5 100644",
"--- a/anonymous-function.js",
"+++ b/anonymous-function.js",
"@@ -1,2 +1 @@",
"-function(a,b) { return a + b; }",
" function(b,c) { return b * c; }"
],
"gitDir": "test/corpus/repos/javascript",
"shas": "fa0cd2354feb5199209c9aa13525567951185c88..a93d062ea69a6600b3f795d769e2557042925d66"
}
,{
"testCaseDescription": "javascript-anonymous-function-delete-rest-test",
"expectedResult": {
"changes": {
"anonymous-function.js": [
{
"span": {
"delete": {
"start": [
1,
1
],
"end": [
1,
32
]
}
},
"summary": "Deleted an anonymous(b, c) function"
}
]
},
"errors": {}
},
"filePaths": [
"anonymous-function.js"
],
"patch": [
"diff --git a/anonymous-function.js b/anonymous-function.js",
"index 9f1856f5..e69de29b 100644",
"--- a/anonymous-function.js",
"+++ b/anonymous-function.js",
"@@ -1 +0,0 @@",
"-function(b,c) { return b * c; }"
],
"gitDir": "test/corpus/repos/javascript",
"shas": "a93d062ea69a6600b3f795d769e2557042925d66..80946fe6667b3843c0bd704136ac929ca5f2e3e0"
}]