centerX should be equal to centerX: C:view1.centerX(view2.centerX)0ms ‣
var constraints = AutoLayout.VisualFormat.parse('C:view1.centerX(view2.centerX)', opts);
assert.equal(1, constraints.length);
var c = constraints[0];
assert.equal(c.view1, 'view1');
assert.equal(c.attr1, 'centerX');
assert.equal(c.relation, 'equ');
assert.equal(c.view2, 'view2');
assert.equal(c.attr2, 'centerX');
centerY should be equal to centerY (implicit attribute): C:view1.centerY(view2)0ms ‣
var constraints = AutoLayout.VisualFormat.parse('C:view1.centerY(view2)', opts);
assert.equal(1, constraints.length);
var c = constraints[0];
assert.equal(c.view1, 'view1');
assert.equal(c.attr1, 'centerY');
assert.equal(c.relation, 'equ');
assert.equal(c.view2, 'view2');
assert.equal(c.attr2, 'centerY');
left should be >= to top: C:view1.left(>=view2.top*2)0ms ‣
var constraints = AutoLayout.VisualFormat.parse('C:view1.left(>=view2.top*2)', opts);
assert.equal(1, constraints.length);
var c = constraints[0];
assert.equal(c.view1, 'view1');
assert.equal(c.attr1, 'left');
assert.equal(c.relation, 'geq');
assert.equal(c.view2, 'view2');
assert.equal(c.attr2, 'top');
assert.equal(c.multiplier, 2);
centerX should be equal to centerX and centerX: C:view1.centerX(view2.centerX,view3.centerX)1ms ‣
var constraints = AutoLayout.VisualFormat.parse('C:view1.centerX(view2.centerX,view3.centerX)', opts);
assert.equal(2, constraints.length);
var c = constraints[0];
assert.equal(c.view1, 'view1');
assert.equal(c.attr1, 'centerX');
assert.equal(c.relation, 'equ');
assert.equal(c.view2, 'view2');
assert.equal(c.attr2, 'centerX');
c = constraints[1];
assert.equal(c.view1, 'view1');
assert.equal(c.attr1, 'centerX');
assert.equal(c.relation, 'equ');
assert.equal(c.view2, 'view3');
assert.equal(c.attr2, 'centerX');
centerX should be equal to centerX and centerX (implicit attributes): C:view1.centerX(view2,view3)0ms ‣
var constraints = AutoLayout.VisualFormat.parse('C:view1.centerX(view2,view3)', opts);
assert.equal(2, constraints.length);
var c = constraints[0];
assert.equal(c.view1, 'view1');
assert.equal(c.attr1, 'centerX');
assert.equal(c.relation, 'equ');
assert.equal(c.view2, 'view2');
assert.equal(c.attr2, 'centerX');
c = constraints[1];
assert.equal(c.view1, 'view1');
assert.equal(c.attr1, 'centerX');
assert.equal(c.relation, 'equ');
assert.equal(c.view2, 'view3');
assert.equal(c.attr2, 'centerX');
chaining syntax: C:view1.centerX(view2.centerX).centerY(view2.centerY)0ms ‣
var constraints = AutoLayout.VisualFormat.parse('C:view1.centerX(view2.centerX).centerY(view2.centerY)', opts);
assert.equal(2, constraints.length);
var c = constraints[0];
assert.equal(c.view1, 'view1');
assert.equal(c.attr1, 'centerX');
assert.equal(c.relation, 'equ');
assert.equal(c.view2, 'view2');
assert.equal(c.attr2, 'centerX');
c = constraints[1];
assert.equal(c.view1, 'view1');
assert.equal(c.attr1, 'centerY');
assert.equal(c.relation, 'equ');
assert.equal(c.view2, 'view2');
assert.equal(c.attr2, 'centerY');
chaining syntax (implicit attributes): C:view1.centerX(view2).centerY(view2)0ms ‣
var constraints = AutoLayout.VisualFormat.parse('C:view1.centerX(view2).centerY(view2)', opts);
assert.equal(2, constraints.length);
var c = constraints[0];
assert.equal(c.view1, 'view1');
assert.equal(c.attr1, 'centerX');
assert.equal(c.relation, 'equ');
assert.equal(c.view2, 'view2');
assert.equal(c.attr2, 'centerX');
c = constraints[1];
assert.equal(c.view1, 'view1');
assert.equal(c.attr1, 'centerY');
assert.equal(c.relation, 'equ');
assert.equal(c.view2, 'view2');
assert.equal(c.attr2, 'centerY');