Tests helpers: add compareSegmentPoints function.

This commit is contained in:
Jonathan Puckey 2011-05-21 20:36:30 +02:00
parent 667992e9f0
commit 0fdfd0033f

View file

@ -193,6 +193,21 @@ function compareParagraphStyles(paragraphStyle, paragraphStyle2, checkIdentity)
});
}
function compareSegmentPoints(segmentPoint, segmentPoint2, checkIdentity) {
if (checkIdentity) {
equals(function() {
return segmentPoint !== segmentPoint2;
}, true);
}
var keys = ['selected', 'x', 'y'];
for (var i = 0, l = keys.length; i < l; i++) {
var key = keys[i];
equals(function() {
return segmentPoint[key] == segmentPoint2[key];
}, true, 'Compare SegmentPoint#' + key);
}
}
function compareSegments(segment, segment2, checkIdentity) {
var keys = ['handleIn', 'handleOut', 'point'];
if (checkIdentity) {