jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/354914 )

Change subject: tests: Cover ve.util#sparseSplice edge case
......................................................................


tests: Cover ve.util#sparseSplice edge case

Change-Id: I46202900e1615f2ee53b37275346f43746f7637c
---
M tests/ve.test.js
1 file changed, 6 insertions(+), 4 deletions(-)

Approvals:
  Esanders: Looks good to me, approved
  Divec: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/tests/ve.test.js b/tests/ve.test.js
index d6d6d95..a5c513e 100644
--- a/tests/ve.test.js
+++ b/tests/ve.test.js
@@ -211,7 +211,7 @@
 } );
 
 QUnit.test( 'sparseSplice', function ( assert ) {
-       var tests, i, len, test;
+       var tests, i, len, test, scratch;
        // Convert a sparse array of primitives to an array of strings, with '' 
for holes.
        // This is needed because QUnit.equiv treats holes as equivalent to 
undefined.
        function mapToString( flatArray ) {
@@ -238,8 +238,9 @@
                        msg + ': modification'
                );
        }
+       /* eslint-disable no-sparse-arrays */
+       scratch = [ 4, , 5, , 6 ];
        tests = [
-               /* eslint-disable no-sparse-arrays */
                // arr, offset, remove, data, expectedReturn, expectedArray, msg
                [ [], 0, 0, [ , 3 ], [], [ , 3 ], 'insert empty, leading hole' 
],
                [ [], 0, 0, [ 1, , 3 ], [], [ 1, , 3 ], 'insert empty, middle 
hole' ],
@@ -259,9 +260,10 @@
 
                [ [ 4, , 5, , 6 ], 0, 3, [ 1, , 3 ], [ 4, , 5 ], [ 1, , 3, , 6 
], 'diff=0 start' ],
                [ [ 4, , 5, , 6 ], 1, 3, [ 1, , 3 ], [ , 5, , ], [ 4, 1, , 3, 6 
], 'diff=0 mid' ],
-               [ [ 4, , 5, , 6 ], 2, 3, [ 1, , 3 ], [ 5, , 6 ], [ 4, , 1, , 3 
], 'diff=0 end' ]
-               /* eslint-enable no-sparse-arrays */
+               [ [ 4, , 5, , 6 ], 2, 3, [ 1, , 3 ], [ 5, , 6 ], [ 4, , 1, , 3 
], 'diff=0 end' ],
+               [ scratch, 0, 0, scratch, [], [ 4, , 5, , 6, 4, , 5, , 6 ], 
'reference-identical arr and data' ]
        ];
+       /* eslint-enable no-sparse-arrays */
 
        assert.notDeepEqual(
                // eslint-disable-next-line no-sparse-arrays

-- 
To view, visit https://gerrit.wikimedia.org/r/354914
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I46202900e1615f2ee53b37275346f43746f7637c
Gerrit-PatchSet: 2
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Jforrester <jforres...@wikimedia.org>
Gerrit-Reviewer: Divec <da...@troi.org>
Gerrit-Reviewer: Esanders <esand...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to