diff options
author | Eliot Horowitz <eliot@10gen.com> | 2009-05-15 13:03:03 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2009-05-15 13:03:03 -0400 |
commit | 540f479a90273ec47248161086974edbc16ecd05 (patch) | |
tree | b7eb8343f9068bea8fef0c24d92c27e0a26be04d /shell/utils.js | |
parent | a3de62485bc1bba72f836dc0faf531dd6f387738 (diff) | |
download | mongo-540f479a90273ec47248161086974edbc16ecd05.tar.gz |
make assert.eq better
Diffstat (limited to 'shell/utils.js')
-rw-r--r-- | shell/utils.js | 5 |
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 ){ |