summaryrefslogtreecommitdiff
path: root/jstests/sort1.js
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2009-01-31 18:06:10 -0500
committerEliot Horowitz <eliot@10gen.com>2009-01-31 18:06:10 -0500
commita85951a5355af5f70866596ed043133cb1e5b3cc (patch)
treefa0a7c5e7a49154a2bc63c5517281b3e42ab3b6a /jstests/sort1.js
parent4949ec5d2b8743738b53a6774f01c71b3647fd64 (diff)
downloadmongo-a85951a5355af5f70866596ed043133cb1e5b3cc.tar.gz
cleaning
Diffstat (limited to 'jstests/sort1.js')
-rw-r--r--jstests/sort1.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/jstests/sort1.js b/jstests/sort1.js
index 2b3d72d02dd..20dd1892f8c 100644
--- a/jstests/sort1.js
+++ b/jstests/sort1.js
@@ -1,5 +1,9 @@
// test sorting, mainly a test ver simple with no index
+debug = function( s ){
+ //print( s );
+}
+
t = db.sorrrt;
t.drop();
@@ -9,7 +13,7 @@ t.save({x:2,z:33});
t.save({x:3,z:33});
t.save({x:1,z:33});
-print( "a" )
+debug( "a" )
for( var pass = 0; pass < 2; pass++ ) {
assert( t.find().sort({x:1})[0].x == 1 );
assert( t.find().sort({x:1}).skip(1)[0].x == 2 );
@@ -21,7 +25,7 @@ for( var pass = 0; pass < 2; pass++ ) {
}
-print( "b" )
+debug( "b" )
assert(t.validate().valid);
@@ -31,16 +35,16 @@ db.bar.save({x:'aba'});
db.bar.save({x:'zed'});
db.bar.save({x:'foo'});
-print( "c" )
+debug( "c" )
for( var pass = 0; pass < 2; pass++ ) {
- print( tojson( db.bar.find().sort( { "x" : 1 } ).limit(1).next() ) );
+ debug( tojson( db.bar.find().sort( { "x" : 1 } ).limit(1).next() ) );
assert.eq( "a" , db.bar.find().sort({'x': 1}).limit(1).next().x , "c.1" );
assert.eq( "a" , db.bar.find().sort({'x': 1}).next().x , "c.2" );
assert.eq( "zed" , db.bar.find().sort({'x': -1}).limit(1).next().x , "c.3" );
assert.eq( "zed" , db.bar.find().sort({'x': -1}).next().x , "c.4" );
}
-print( "d" )
+debug( "d" )
assert(db.bar.validate().valid);