Преглед на файлове

EAGLESIX-2695 Fiddled with the test cases.

Tony Ennis преди 11 години
родител
ревизия
c0a83e74d0
променени са 1 файла, в които са добавени 5 реда и са изтрити 2 реда
  1. 5 2
      test/lib/pipeline/expressions/LetExpression_test.js

+ 5 - 2
test/lib/pipeline/expressions/LetExpression_test.js

@@ -154,8 +154,11 @@ module.exports = {
 					var x = Expression.parseOperand(
 						{$let: { vars: { total: { $add: [ '$price', '$tax' ] },	discounted: { $cond: { if: '$applyDiscount', then: 0.9, else: 1 } }}, in: { $multiply: [ '$$total', '$$discounted' ] }}},
 						this.vps).optimize();
-					var y = x.evaluate(new Variables(10, {price: 90, tax: .05}));
-					assert.equal(y, 100);
+					var y;
+					y = x.evaluate(new Variables(10, {price: 90, tax: .05}));
+					assert.equal(y, 90.05);
+					y = x.evaluate(new Variables(10, {price: 90, tax: .05, applyDiscount: 1}));
+					assert.equal(y, 90.05 * .9);
 				}
 			},
 		}