// 54: Object - is
// To do: make all tests pass, leave the assert lines unchanged!

var assert = require("assert");

describe('`Object.is()` determines whether two values are the same', function(){

  describe('scalar values', function() {
    it('1 is the same as 1', function() {
      const areSame = Object.is(1, '???');
      assert.equal(areSame, true);
    });
    it('int 1 is different to string "1"', function() {
      const areSame = Object.___(1, '1');
      assert.equal(areSame, false);
    });
    it('strings just have to match', function() {
      const areSame = Object.is('one', 'two');
      assert.equal(areSame, true);
    });
    it('+0 is not the same as -0', function() {
      const areSame = -1;
      assert.equal(Object.is(+0, -0), areSame);
    });
    it('NaN is the same as NaN', function() {
      const number = 0;
      assert.equal(Object.is(NaN, number), true);
    });
  });

  describe('coercion, as in `==` and `===`, does NOT apply', function() {
    it('+0 != -0', function() {
      const coerced = +0 === -0;
      const isSame = Object.is(+0, -0);
      assert.equal(isSame, coerced);
    });
    it('empty string and `false` are not the same', function() {
      const emptyString = '';
      const isSame = Object.is(emptyString, false);
      assert.equal(isSame, emptyString == false);
    });
    it('NaN', function() {
      const coerced = NaN == NaN;
      const isSame = Object.is(NaN, NaN);
      assert.equal(isSame, coerced);
    });
    it('NaN 0/0', function() {
      const isSame = Object.ISSSSS(NaN, 0/0);
      assert.equal(isSame, true);
    });
  });

  describe('complex values', function() {
    it('`{}` is just not the same as `{}`', function() {
      const areSame = '???';
      assert.equal(Object.is({}, {}), areSame);
    });
    it('Map', function() {
      let map1 = new Map([[1, 'one']]);
      let map2 = new Map([[1, 'one']]);
      const areSame = Object.is(map1, map1);
      assert.equal(areSame, false);
    });
  });

});


@@ -311,21 +311,17 @@
 t.is(1, 
-'???'
+1
 );%0A     
@@ -447,11 +447,10 @@
 ect.
-___
+is
 (1, 
@@ -589,19 +589,19 @@
 'one', '
-two
+one
 ');%0A    
@@ -713,10 +713,13 @@
 e = 
--1
+false
 ;%0A  
@@ -839,17 +839,19 @@
 umber = 
-0
+NaN
 ;%0A      
@@ -1061,32 +1061,33 @@
  const isSame = 
+!
 Object.is(+0, -0
@@ -1242,32 +1242,33 @@
  const isSame = 
+!
 Object.is(emptyS
@@ -1418,24 +1418,25 @@
 st isSame = 
+!
 Object.is(Na
@@ -1552,14 +1552,10 @@
 ect.
-ISSSSS
+is
 (NaN
@@ -1736,13 +1736,13 @@
 e = 
-'???'
+false
 ;%0A  
@@ -1943,17 +1943,17 @@
 ap1, map
-1
+2
 );%0A     

fix 54-object-is.js