var Lab = require('lab');
var lab = exports.lab = Lab.script();

var describe = lab.describe;
var it = lab.it;
var expect = Lab.expect;

var equals = require('../equals');

describe('equals', function() {
  it('should work like Object.is', function (done) {
    var obj = {};
    var compares = [
      ['hey', 'hey'],
      [2, 2],
      [obj, obj],
      ['hey', 'hey'],
      [2, '3'],
      [obj, {}],
      [false, ''],
      [+1, -1],
      [Number.NaN, NaN]
    ];
    compares.forEach(function (items) {
      expect(equals(items[0], items[1])).to.equal(Object.is(items[0], items[1]));
    });
    // Monkey patching Object.is, better way?
    var temp = Object.is;
    Object.is = false;
    compares.forEach(function (items) {
      expect(equals(items[0], items[1])).to.equal(temp(items[0], items[1]));
    });
    Object.is = temp;
    done();
  });
  it('should works with array functions', function (done) {
    expect([1,2,3].map(equals(1))).to.be.eql([true, false, false]);
    done();
  });
});

@@ -457,16 +457,30 @@
 aN, NaN%5D
+,%0A      %5B0, 0%5D
 %0A    %5D;%0A

test case for 100% coverage