Skip to content

Commit

Permalink
Fixes tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
slightlyoff committed Jun 29, 2012
1 parent 99751c0 commit 17f6ecc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/LinearConstraint-test.js
Expand Up @@ -91,10 +91,10 @@ doh.add("c.LinearConstraint", [
var v2 = new c.Variable('v2', 5);
var ieq = new c.LinearInequality(v1, c.GEQ, v2);

t.is(ieq.expression, '-1*[v2:5] + 1*[v1:10]');
t.is(ieq.expression, '1*[v1:10] + -1*[v2:5]');

ieq = new c.LinearInequality(v1, c.LEQ, v2);
t.is(ieq.expression, '1*[v2:5] + -1*[v1:10]');
t.is(ieq.expression, '-1*[v1:10] + 1*[v2:5]');
},

function inequality_var_op_num(t) {
Expand Down Expand Up @@ -123,20 +123,20 @@ doh.add("c.LinearConstraint", [
var e = new c.LinearExpression(new c.Variable('x', 5), 2, 4);
var ieq = new c.LinearInequality(v, c.GEQ, e);

t.is(ieq.expression, '-4 + -2*[x:5] + 1*[v:10]');
t.is(ieq.expression, '-4 + 1*[v:10] + -2*[x:5]');

ieq = new c.LinearInequality(v, c.LEQ, e);
t.is(ieq.expression, '4 + 2*[x:5] + -1*[v:10]');
t.is(ieq.expression, '4 + -1*[v:10] + 2*[x:5]');
},

function inequality_exp_op_var(t) {
var v = new c.Variable('v', 10);
var e = new c.LinearExpression(new c.Variable('x', 5), 2, 4);
var ieq = new c.LinearInequality(e, c.GEQ, v);

t.is(ieq.expression, '4 + 2*[x:5] + -1*[v:10]');
t.is(ieq.expression, '4 + -1*[v:10] + 2*[x:5]');

ieq = new c.LinearInequality(e, c.LEQ, v);
t.is(ieq.expression, '-4 + -2*[x:5] + 1*[v:10]');
t.is(ieq.expression, '-4 + 1*[v:10] + -2*[x:5]');
}
]);

0 comments on commit 17f6ecc

Please sign in to comment.