From 40c4ad7e28c0a92dabf495a244d145a3238afd5d Mon Sep 17 00:00:00 2001 From: dwight Date: Fri, 2 Jul 2010 12:44:39 -0400 Subject: better jstest --- jstests/apitest_db.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/jstests/apitest_db.js b/jstests/apitest_db.js index 45e25b6300b..f54879ca5f1 100644 --- a/jstests/apitest_db.js +++ b/jstests/apitest_db.js @@ -2,6 +2,8 @@ * Tests for the db object enhancement */ +assert( "test" == db, "wrong database currently not test" ); + dd = function( x ){ //print( x ); } @@ -34,7 +36,7 @@ dd( "d" ); db.createCollection("test"); var found = false; db.getCollection( "system.namespaces" ).find().forEach( function(x) { if (x.name == "test.test") found = true; }); -assert(found); +assert(found, "found test.test in system.namespaces"); dd( "e" ); @@ -43,16 +45,16 @@ dd( "e" ); */ db.setProfilingLevel(0); -assert(db.getProfilingLevel() == 0); +assert(db.getProfilingLevel() == 0, "prof level 0"); db.setProfilingLevel(1); -assert(db.getProfilingLevel() == 1); +assert(db.getProfilingLevel() == 1, "p1"); db.setProfilingLevel(2); -assert(db.getProfilingLevel() == 2); +assert(db.getProfilingLevel() == 2, "p2"); db.setProfilingLevel(0); -assert(db.getProfilingLevel() == 0); +assert(db.getProfilingLevel() == 0, "prof level 0"); dd( "f" ); asserted = false; @@ -64,7 +66,7 @@ catch (e) { asserted = true; assert(e.dbSetProfilingException); } -assert( asserted ); +assert( asserted, "should have asserted" ); dd( "g" ); -- cgit v1.2.1