Jforrester has uploaded a new change for review.
https://gerrit.wikimedia.org/r/269889
Change subject: ve.dm.ElementLinearData.static.compareElements: Add a couple of
missed test cases
......................................................................
ve.dm.ElementLinearData.static.compareElements: Add a couple of missed test
cases
Change-Id: I40fcebc1fda2ffe7e0465e7e76b72a655de36bbb
---
M tests/dm/lineardata/ve.dm.ElementLinearData.test.js
1 file changed, 47 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor
refs/changes/89/269889/1
diff --git a/tests/dm/lineardata/ve.dm.ElementLinearData.test.js
b/tests/dm/lineardata/ve.dm.ElementLinearData.test.js
index f545c08..ee289a6 100644
--- a/tests/dm/lineardata/ve.dm.ElementLinearData.test.js
+++ b/tests/dm/lineardata/ve.dm.ElementLinearData.test.js
@@ -1961,7 +1961,53 @@
}
} );
-// TODO: ve.dm.ElementLinearData.static.compareElements
+QUnit.test( 'compareElements', function ( assert ) {
+ var i,
+ cases = [
+ {
+ a: '母',
+ b: '母',
+ comparison: true,
+ msg: 'Identical unannotated charaters are
identical'
+ },
+ {
+ a: '다',
+ b: '가',
+ comparison: false,
+ msg: 'Non-identical unannotated charaters are
not identical'
+ },
+ {
+ a: [
+ [ 'F', [ 0 ] ]
+ ],
+ b: [
+ [ 'F', [ 0 ] ]
+ ],
+ comparison: true,
+ msg: 'Identically-annotated identical charaters
are identical'
+ },
+ {
+ a: [
+ [ 'F', [ 0 ] ]
+ ],
+ b: [
+ [ 'F', [ 1 ] ]
+ ],
+ comparison: false,
+ msg: 'Non-identically-annotated identical
charaters are not identical'
+ }
+ ];
+
+ QUnit.expect( cases.length );
+ for ( i = 0; i < cases.length; i++ ) {
+ assert.equal(
+ ve.dm.ElementLinearData.static.compareElements( cases[
i ].a, cases[ i ].b ),
+ cases[ i ].comparison,
+ cases[ i ].msg
+ );
+ }
+} );
+
// TODO: ve.dm.ElementLinearData#getAnnotationIndexesFromOffset
// TODO: ve.dm.ElementLinearData#setAnnotationsAtOffset
// TODO: ve.dm.ElementLinearData#getCharacterData
--
To view, visit https://gerrit.wikimedia.org/r/269889
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I40fcebc1fda2ffe7e0465e7e76b72a655de36bbb
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Jforrester <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits