summaryrefslogtreecommitdiff
path: root/shell/utils.js
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2009-05-15 13:03:03 -0400
committerEliot Horowitz <eliot@10gen.com>2009-05-15 13:03:03 -0400
commit540f479a90273ec47248161086974edbc16ecd05 (patch)
treeb7eb8343f9068bea8fef0c24d92c27e0a26be04d /shell/utils.js
parenta3de62485bc1bba72f836dc0faf531dd6f387738 (diff)
downloadmongo-540f479a90273ec47248161086974edbc16ecd05.tar.gz
make assert.eq better
Diffstat (limited to 'shell/utils.js')
-rw-r--r--shell/utils.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/shell/utils.js b/shell/utils.js
index 0b757fa93d8..450197d5f0b 100644
--- a/shell/utils.js
+++ b/shell/utils.js
@@ -10,10 +10,11 @@ assert.eq = function( a , b , msg ){
if ( a == b )
return;
- if ( a != null && b != null && a.toString() == b.toString() )
+ if ( ( a != null && b != null ) &&
+ ( a.toString() == b.toString() || a == b || tojson( a ) == tojson( b ) ) )
return;
- throw "[" + a + "] != [" + b + "] are not equal : " + msg;
+ throw "[" + tojson( a ) + "] != [" + tojson( b ) + "] are not equal : " + msg;
}
assert.neq = function( a , b , msg ){