diff options
author | Eliot Horowitz <eliot@10gen.com> | 2011-07-27 13:47:13 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2011-07-27 13:47:13 -0400 |
commit | 0084b65772783eefb88f9666ac0c716a37abf1d8 (patch) | |
tree | e07b50582c5c9feffe19d63b6d3cd2d28aa026ad /shell | |
parent | b0fa1f80f3b8ecb9b2d75ec910b393b83cf35cc7 (diff) | |
download | mongo-0084b65772783eefb88f9666ac0c716a37abf1d8.tar.gz |
fix shell assignment
Diffstat (limited to 'shell')
-rw-r--r-- | shell/mongo_vstudio.cpp | 12 | ||||
-rw-r--r-- | shell/utils.js | 2 |
2 files changed, 13 insertions, 1 deletions
diff --git a/shell/mongo_vstudio.cpp b/shell/mongo_vstudio.cpp index 85467102383..991e29636bf 100644 --- a/shell/mongo_vstudio.cpp +++ b/shell/mongo_vstudio.cpp @@ -216,6 +216,18 @@ const StringData _jscode_raw_utils = "doassert( a + \" is not greater than or eq \" + b + \" : \" + msg );\n" "}\n" "\n" +"assert.between = function( a, b, c, msg, inclusive ){\n" +"if ( assert._debug && msg ) print( \"in assert for: \" + msg );\n" +"\n" +"if( ( inclusive == undefined || inclusive == true ) &&\n" +"a <= b && b <= c ) return;\n" +"else if( a < b && b < c ) return;\n" +"\n" +"doassert( b + \" is not between \" + a + \" and \" + c + \" : \" + msg );\n" +"}\n" +"\n" +"assert.betweenIn = function( a, b, c, msg ){ assert.between( a, b, c, msg, true ) }\n" +"assert.betweenEx = function( a, b, c, msg ){ assert.between( a, b, c, msg, false ) }\n" "\n" "assert.close = function( a , b , msg , places ){\n" "if (places === undefined) {\n" diff --git a/shell/utils.js b/shell/utils.js index b7c9153ba30..9ae3640870e 100644 --- a/shell/utils.js +++ b/shell/utils.js @@ -214,7 +214,7 @@ assert.gte = function( a , b , msg ){ assert.between = function( a, b, c, msg, inclusive ){ if ( assert._debug && msg ) print( "in assert for: " + msg ); - if( ( inclusive == undefined || inclusive = true ) && + if( ( inclusive == undefined || inclusive == true ) && a <= b && b <= c ) return; else if( a < b && b < c ) return; |