message: Add expression unit test: Check contains with empty array
diff: import {
  parse,
  SyntaxError,
  - ParseFunction
  + ParseFunction,
  } from "../../src/expressions/expressionParser";
  import { ConditionRunner, ExpressionRunner } from "../../src/conditions";
  @@ -12,7 +12,7 @@ import {
  Const,
  Variable,
  BinaryOperand,
  - UnaryOperand
  + UnaryOperand,
  } from "../../src/expressions/expressions";
  import { ProcessValue } from "../../src/conditionProcessValue";
  @@ -215,7 +215,7 @@ QUnit.test("Condition check #303", function(assert) {
  assert.equal(runner.run(values), false, "nothing was set");
  values = {
  "question-fruit": "fruit-apple",
  - "question-apple-variety": "apple-variety-red-delicious"
  + "question-apple-variety": "apple-variety-red-delicious",
  };
  assert.equal(runner.run(values), true, "The first part is correct");
  values["question-fruit"] = "fruit-orange";
  @@ -386,6 +386,11 @@ QUnit.test("Bug with contains, bug#781", function(assert) {
  assert.equal(runner.run(values), false, "['2'] contains '1'");
  });
  +QUnit.test("Check contains with empty array", function (assert) {
  + var runner = new ConditionRunner("[] contains 'C1'");
  + assert.equal(runner.run({}), false, "[] doesn't contain 'C1'");
  +});
  +
  QUnit.test("contains as equal", function (assert) {
  var runner = new ConditionRunner("{val} contains 'value'");
  var values = { val: "value" };
  @@ -535,7 +540,7 @@ QUnit.test("ExpressionRunner: sumInArray", function(assert) {
  QUnit.test("ExpressionRunner: sumInArray, for objects", function (assert) {
  var runner = new ExpressionRunner("sumInArray({a}, 'val1')");
  var values = {
  - a: { row1: { val1: 10 }, row2: { val2: 10 }, row3: { val1: 20 } }
  + a: { row1: { val1: 10 }, row2: { val2: 10 }, row3: { val1: 20 } },
  };
  assert.equal(runner.run(values), 30, "10 + 20");
  });
  @@ -613,7 +618,7 @@ QUnit.test(
  REVIEW_COVER: ["REVIEW_SM", "REVIEW_GL"],
  RATES_PROPERTY_SD: 1,
  RATES_LIABILITY_SD: 2,
  - RATES_SEXUAL_MOL_END_SD: 3
  + RATES_SEXUAL_MOL_END_SD: 3,
  };
  assert.equal(
  runner.run(values),
  @@ -638,7 +643,9 @@ QUnit.test("Variable may have '-' and '+' in their names", function(assert) {
  assert.equal(runner.run(values), false, "2 != 1");
  });
  -QUnit.test("Variable equals 0x1 works incorrectly, Bug#1180", function(assert) {
  +QUnit.test("Variable equals 0x1 works incorrectly, Bug#1180", function (
  + assert
  +) {
  var runner = new ConditionRunner("{val} notempty");
  var values = { val: "0x1" };
  assert.equal(runner.run(values), true, "0x1 is not empty");
  