Permalink
Browse files

no longer showing NaN and NaN as different

- adding test to reproduce issue
- switching out deep-equal with deep-is
  • Loading branch information...
1 parent 31df4c5 commit 19a92248e90b44a413b231baaa3463f2d7867327 @thlorenz thlorenz committed Apr 11, 2013
Showing with 19 additions and 2 deletions.
  1. +1 −1 index.js
  2. +1 −1 package.json
  3. +17 −0 test/diffing-NaN.js
View
@@ -1,7 +1,7 @@
var traverse = require('traverse');
var Stream = require('stream').Stream;
var charm = require('charm');
-var deepEqual = require('deep-equal');
+var deepEqual = require('deep-is');
var exports = module.exports = function (opts_) {
var fn = difflet.bind(null, opts_);
View
@@ -23,7 +23,7 @@
"dependencies" : {
"traverse" : "0.6.x",
"charm" : "0.0.x",
- "deep-equal" : "0.0.x"
+ "deep-is" : "0.1.x"
},
"devDependencies" : {
"tap" : "0.1.x",
View
@@ -0,0 +1,17 @@
+var difflet = require('../');
+var diff = difflet();
+var test = require('tap').test;
+
+test('diffing NaN against NaN', function (t) {
+ t.plan(1);
+ var d = diff.compare(NaN, NaN);
+
+ t.equal(d, 'NaN');
+});
+
+test('diffing { o: NaN } against { o: NaN }', function (t) {
+ t.plan(1);
+ var d = diff.compare({ o: NaN }, { o: NaN });
+
+ t.equal(d, '{"o":NaN}');
+});

0 comments on commit 19a9224

Please sign in to comment.