From 91efa3fcd9881484d4bb5da14a307c0f06d4c4d5 Mon Sep 17 00:00:00 2001 From: Eliot Horowitz Date: Tue, 5 Jul 2011 00:46:50 -0400 Subject: [PATCH] more forgiving assert.eq --- shell/mongo_vstudio.cpp | 6 +++--- shell/utils.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/shell/mongo_vstudio.cpp b/shell/mongo_vstudio.cpp index d34c6c5695d..651830ace7d 100644 --- a/shell/mongo_vstudio.cpp +++ b/shell/mongo_vstudio.cpp @@ -15,14 +15,14 @@ const StringData _jscode_raw_utils = "if ( a == b )\n" "return true;\n" "\n" -"a = tojson(a);\n" -"b = tojson(b);\n" +"a = tojson(a,false,true);\n" +"b = tojson(b,false,true);\n" "\n" "if ( a == b )\n" "return true;\n" "\n" "var clean = function( s ){\n" -"s = s.replace( /NumberInt\\((\\d+)\\)/ , \"$1\" );\n" +"s = s.replace( /NumberInt\\((\\-?\\d+)\\)/g , \"$1\" );\n" "return s;\n" "}\n" "\n" diff --git a/shell/utils.js b/shell/utils.js index ebc4999d2f6..10eca2356e0 100644 --- a/shell/utils.js +++ b/shell/utils.js @@ -10,14 +10,14 @@ friendlyEqual = function( a , b ){ if ( a == b ) return true; - a = tojson(a); - b = tojson(b); + a = tojson(a,false,true); + b = tojson(b,false,true); if ( a == b ) return true; var clean = function( s ){ - s = s.replace( /NumberInt\((\d+)\)/ , "$1" ); + s = s.replace( /NumberInt\((\-?\d+)\)/g , "$1" ); return s; }