How to use the assert.eql function in assert

To help you get started, we’ve selected a few assert examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github adaltas / node-printf / test / sprintf.js View on Github external
'Flag: 0': function(){
        assert.eql("42", printf("%0d", 42));
        assert.eql("-42", printf("%0d", -42));
        assert.eql("00042", printf("%05d", 42));
        assert.eql("-00042", printf("%05d", -42));
        assert.eql("000000000000042", printf("%015d", 42));
        assert.eql("-000000000000042", printf("%015d", -42));
    },
    'Flag: -': function(){
github tokumine / sweepline / test / test_point.js View on Github external
exports['test equality'] = function(){
  var p0 = new Point(1,1);
  assert.eql(p0.compare(p0), 0);
};
github tokumine / sweepline / test / test_binary_search_tree.js View on Github external
exports['test add multiple'] = function(){
  var bst = new BinarySearchTree();
  bst.add(5);
  bst.add(10);

  assert.eql(2, bst.size(), "Tree should have two items.");
  assert.eql(5, bst.value, "First item should have value of 5.");
};
github shanielh / node-date-diff / test / time-tests.js View on Github external
return function(actualSign, actualNumber, actualUnit) {

		assert.eql(expectedSign, actualSign);
		assert.eql(expectedNumber, actualNumber);
		assert.eql(expectedUnit, actualUnit);
		
	}
}
github danwrong / loadbuilder / test / analyzer.js View on Github external
matches = analyzer.analyze({
        "type": "CallExpression",
        "callee": {
            "type": "Identifier",
            "name": "require"
        },
        "arguments": [
            {
                "type": "Literal",
                "value": null
            }
        ]
    }, src);

    assert.eql(matches[0].values, ['blah']);
  }
}
github tokumine / sweepline / test / test_binary_search_tree.js View on Github external
exports['test should be able to remove first node'] = function(){
  var bst = new BinarySearchTree();
  bst.add(5);
  bst.add(10);
  bst.add(6);    
  bst.remove(5)
  
  assert.eql(2, bst.size(), "Tree should have 2 items.");
  assert.eql(10, bst.value, "root should now be 10");
  assert.ok(!bst.contains(5));
};